hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7173f406336288e5f91314047a20cea6d7099ba | 29,908 | py | Python | tests/test_sklearn_pipeline.py | vumichien/hummingbird | 8981e11ce2536167c329a5d9d20e81125a792fe4 | [
"MIT"
] | 2,772 | 2020-05-04T21:03:40.000Z | 2022-03-30T11:00:03.000Z | tests/test_sklearn_pipeline.py | vumichien/hummingbird | 8981e11ce2536167c329a5d9d20e81125a792fe4 | [
"MIT"
] | 486 | 2020-05-05T00:45:44.000Z | 2022-03-15T01:02:31.000Z | tests/test_sklearn_pipeline.py | vumichien/hummingbird | 8981e11ce2536167c329a5d9d20e81125a792fe4 | [
"MIT"
] | 232 | 2019-11-02T22:06:38.000Z | 2022-03-25T07:36:17.000Z | import unittest
import numpy as np
from sklearn import datasets
from sklearn.compose import ColumnTransformer
from sklearn.datasets import load_iris, load_diabetes
from sklearn.svm import LinearSVC, LinearSVR
from sklearn.datasets import make_regression
from sklearn.decomposition import PCA
from sklearn.linear_model i... | 40.307278 | 127 | 0.630032 | import unittest
import numpy as np
from sklearn import datasets
from sklearn.compose import ColumnTransformer
from sklearn.datasets import load_iris, load_diabetes
from sklearn.svm import LinearSVC, LinearSVR
from sklearn.datasets import make_regression
from sklearn.decomposition import PCA
from sklearn.linear_model i... | true | true |
f7173f7ed9d0c8bc4d136449f83ae47f59a3b4aa | 161 | py | Python | shiyanlou_cs596-1805f3c438/design3.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | shiyanlou_cs596-1805f3c438/design3.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | shiyanlou_cs596-1805f3c438/design3.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
row = int(input("Enter the number of rows: "))
n = row
while n >= 0:
x = "*" * n
y = " " * (row - n)
print(y + x)
n -= 1
| 17.888889 | 46 | 0.459627 |
row = int(input("Enter the number of rows: "))
n = row
while n >= 0:
x = "*" * n
y = " " * (row - n)
print(y + x)
n -= 1
| true | true |
f7173fb688f43ba2ac42d7b1dfdd0e7fc7e3dcf5 | 3,784 | py | Python | Lib/site-packages/django_extensions/validators.py | Nibraz15/FullTextSearch | 79d03a9b5c0fc94219ad9a70fe57818496844660 | [
"bzip2-1.0.6"
] | 1 | 2019-12-22T23:37:28.000Z | 2019-12-22T23:37:28.000Z | Lib/site-packages/django_extensions/validators.py | Nibraz15/FullTextSearch | 79d03a9b5c0fc94219ad9a70fe57818496844660 | [
"bzip2-1.0.6"
] | 10 | 2020-06-05T21:41:01.000Z | 2022-02-10T07:33:38.000Z | Lib/site-packages/django_extensions/validators.py | Nibraz15/FullTextSearch | 79d03a9b5c0fc94219ad9a70fe57818496844660 | [
"bzip2-1.0.6"
] | 3 | 2020-08-07T16:16:54.000Z | 2020-10-12T18:06:35.000Z | # -*- coding: utf-8 -*-
import unicodedata
import binascii
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
@deconstructible
class NoControlCharactersValidator(... | 34.4 | 123 | 0.624736 |
import unicodedata
import binascii
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
@deconstructible
class NoControlCharactersValidator(object):
message = ... | true | true |
f71740b8d42b1368ce90e20d97da178845afeb85 | 2,344 | py | Python | nodes/lcm_to_ros/xtion/rgbd_t.py | mrfmap/mrfmap_ros | 8c1e108860ff297f39591d97f8f8ce2937b29a51 | [
"BSD-3-Clause"
] | 6 | 2020-07-15T21:00:49.000Z | 2021-05-12T07:16:38.000Z | nodes/lcm_to_ros/xtion/rgbd_t.py | mrfmap/mrfmap_ros | 8c1e108860ff297f39591d97f8f8ce2937b29a51 | [
"BSD-3-Clause"
] | 2 | 2020-08-14T16:16:21.000Z | 2020-11-12T07:43:22.000Z | nodes/lcm_to_ros/xtion/rgbd_t.py | mrfmap/mrfmap_ros | 8c1e108860ff297f39591d97f8f8ce2937b29a51 | [
"BSD-3-Clause"
] | 2 | 2020-08-16T15:53:14.000Z | 2021-05-12T07:16:41.000Z | """LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class rgbd_t(object):
__slots__ = ["utime", "width", "height", "rgblen", "depthlen", "rgb", "depth"]
__typ... | 32.555556 | 111 | 0.638652 |
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class rgbd_t(object):
__slots__ = ["utime", "width", "height", "rgblen", "depthlen", "rgb", "depth"]
__typenames__ = ["int64_t", "int32_t", "int32_t", "int32_t", "int32_t", "byte", "byte"]
__dimens... | true | true |
f717410eba8874ad5c80c1bd9eb7064162476ab8 | 967 | py | Python | Trakttv.bundle/Contents/Tests/plex_mock/models.py | disrupted/Trakttv.bundle | 24712216c71f3b22fd58cb5dd89dad5bb798ed60 | [
"RSA-MD"
] | 1,346 | 2015-01-01T14:52:24.000Z | 2022-03-28T12:50:48.000Z | Trakttv.bundle/Contents/Tests/plex_mock/models.py | alcroito/Plex-Trakt-Scrobbler | 4f83fb0860dcb91f860d7c11bc7df568913c82a6 | [
"RSA-MD"
] | 474 | 2015-01-01T10:27:46.000Z | 2022-03-21T12:26:16.000Z | Trakttv.bundle/Contents/Tests/plex_mock/models.py | alcroito/Plex-Trakt-Scrobbler | 4f83fb0860dcb91f860d7c11bc7df568913c82a6 | [
"RSA-MD"
] | 191 | 2015-01-02T18:27:22.000Z | 2022-03-29T10:49:48.000Z | class LibraryMetadata(object):
def __init__(self, section=None):
self.section = section
class LibrarySection(object):
def __init__(self, title=None):
self.title = title
class Session(object):
def __init__(self, **kwargs):
self.rating_key = None
self.state = None
... | 21.977273 | 68 | 0.553257 | class LibraryMetadata(object):
def __init__(self, section=None):
self.section = section
class LibrarySection(object):
def __init__(self, title=None):
self.title = title
class Session(object):
def __init__(self, **kwargs):
self.rating_key = None
self.state = None
... | true | true |
f717418e6536d845980ad96232de54991a5746ec | 12,804 | py | Python | app/controller.py | Effenberg0x0/ci_edit | ea78621164152b1f489cae8e53994fad52c01c16 | [
"Apache-2.0"
] | 1 | 2019-01-21T07:35:14.000Z | 2019-01-21T07:35:14.000Z | app/controller.py | Effenberg0x0/ci_edit | ea78621164152b1f489cae8e53994fad52c01c16 | [
"Apache-2.0"
] | null | null | null | app/controller.py | Effenberg0x0/ci_edit | ea78621164152b1f489cae8e53994fad52c01c16 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.873016 | 80 | 0.637848 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import curses
import curses.ascii
import app.config
import app.curses_util
import app.log
class Controller:
def __init__(self, view, name):
if app.config.strict_debug:
... | true | true |
f717419b82396fef65c67279f9002be3e2b4df00 | 4,704 | py | Python | scratchpad/basic_async_server.py | cnb0/katcp-python | 35c860bc17ee6404cc59a14f7d1b8ac1fae4b73c | [
"BSD-3-Clause"
] | 8 | 2015-02-25T20:13:54.000Z | 2019-09-12T06:12:07.000Z | scratchpad/basic_async_server.py | cnb0/katcp-python | 35c860bc17ee6404cc59a14f7d1b8ac1fae4b73c | [
"BSD-3-Clause"
] | 67 | 2015-01-12T09:58:36.000Z | 2021-05-12T14:23:26.000Z | scratchpad/basic_async_server.py | cnb0/katcp-python | 35c860bc17ee6404cc59a14f7d1b8ac1fae4b73c | [
"BSD-3-Clause"
] | 15 | 2015-04-28T13:18:28.000Z | 2021-01-19T16:16:33.000Z | # Copyright 2016 National Research Foundation (South African Radio Astronomy Observatory)
# BSD license - see LICENSE for details
from __future__ import absolute_import, division, print_function
import random
import signal
import time
import tornado
from katcp import AsyncReply, DeviceServer, ProtocolFlags, Sensor
... | 32 | 89 | 0.639881 |
from __future__ import absolute_import, division, print_function
import random
import signal
import time
import tornado
from katcp import AsyncReply, DeviceServer, ProtocolFlags, Sensor
from katcp.kattypes import (Discrete, Float, Str, Timestamp, request,
return_reply)
server_host = "... | true | true |
f71741bac27bc1f5ba082d55bf8dd41a6deacf3b | 2,588 | py | Python | Estructura de datos y su procesamiento/Actividad8-TuplaNominada3.py | fernandomireles/University | 5ebf3cf3e3093a8853cc4903e6f617dda7df4336 | [
"MIT"
] | null | null | null | Estructura de datos y su procesamiento/Actividad8-TuplaNominada3.py | fernandomireles/University | 5ebf3cf3e3093a8853cc4903e6f617dda7df4336 | [
"MIT"
] | null | null | null | Estructura de datos y su procesamiento/Actividad8-TuplaNominada3.py | fernandomireles/University | 5ebf3cf3e3093a8853cc4903e6f617dda7df4336 | [
"MIT"
] | 1 | 2021-08-18T15:21:23.000Z | 2021-08-18T15:21:23.000Z | """
Codificar un algoritmo en Python que permita registrar la clave (Por el momento,
no esn ecesario validar si la clave es unica), el nombre y correo electrónico
de múltiples personas, hasta que el usuario indique que ha concluído con la captura
correspondiente (proponga usted el mecanismo para esto).
Una vez con... | 47.925926 | 111 | 0.651468 |
SEPARADOR = ("*" * 20)
from collections import namedtuple
Personas = namedtuple("Personas",["clave","nombre","correoElectronico"])
ListaPersonas=[]
while True:
print("\n-- Bienvenido(a) al Menu")
print("1) Agregar una persona")
print("2) Búsqueda específica")
print("3) Ver listado comple... | true | true |
f717423cc3d548d9864cbc9e2e9fcc26f024bacd | 1,833 | py | Python | backend/mlarchive/bin/check_spam_legacy.py | dkg/mailarch | 562757c09e212c202c35231d7e7c588cd4d3fb65 | [
"BSD-3-Clause"
] | 6 | 2022-03-09T23:10:28.000Z | 2022-03-21T05:32:40.000Z | backend/mlarchive/bin/check_spam_legacy.py | dkg/mailarch | 562757c09e212c202c35231d7e7c588cd4d3fb65 | [
"BSD-3-Clause"
] | 5 | 2022-03-11T09:39:47.000Z | 2022-03-30T16:48:09.000Z | backend/mlarchive/bin/check_spam_legacy.py | dkg/mailarch | 562757c09e212c202c35231d7e7c588cd4d3fb65 | [
"BSD-3-Clause"
] | 4 | 2022-03-04T15:36:19.000Z | 2022-03-28T23:45:44.000Z | #!../../../env/bin/python
"""
Script to scan through archive of mbox files and produce a spam report.
"""
# Standalone broilerplate -------------------------------------------------------------
from django_setup import do_setup
do_setup()
# -------------------------------------------------------------------------------... | 27.772727 | 87 | 0.585379 |
from django_setup import do_setup
do_setup()
import argparse
import email
import logging
import os
import shutil
import subprocess
import sys
from django.conf import settings
from mlarchive.bin.scan_utils import get_messages
progname = sys.argv[0]
from django.utils.log import getLogger
import logging.config
logg... | true | true |
f717427fe7f805450f84f4ef7ba5df39674ef6cb | 348 | py | Python | ja/code_snippets/api-embeds-enable.py | quotecenter/documentation-1 | f365703264761aa2b19d5d1d8ec55a3a6082ef4d | [
"BSD-3-Clause"
] | null | null | null | ja/code_snippets/api-embeds-enable.py | quotecenter/documentation-1 | f365703264761aa2b19d5d1d8ec55a3a6082ef4d | [
"BSD-3-Clause"
] | null | null | null | ja/code_snippets/api-embeds-enable.py | quotecenter/documentation-1 | f365703264761aa2b19d5d1d8ec55a3a6082ef4d | [
"BSD-3-Clause"
] | null | null | null | from datadog import initialize, api
# Intialize request parameters including API/APP key
options = {
'api_key': '<YOUR_API_KEY>',
'app_key': '<YOUR_APP_KEY>'
}
initialize(**options)
# Set Embed ID (token)
embed_id = "5f585b01c81b12ecdf5f40df0382738d0919170639985d3df5e2fc4232865b0c"
# Call Embed API function... | 21.75 | 77 | 0.761494 | from datadog import initialize, api
options = {
'api_key': '<YOUR_API_KEY>',
'app_key': '<YOUR_APP_KEY>'
}
initialize(**options)
embed_id = "5f585b01c81b12ecdf5f40df0382738d0919170639985d3df5e2fc4232865b0c"
api.Embed.enable(embed_id)
| true | true |
f71742b2238dd40bc0984373a331e975450b3324 | 2,827 | py | Python | tests/TestAptChefProvisionerPlugin.py | dhellmann/aminator | 96efa7d5690bfae2c20b21f0b417b2784f6cb085 | [
"Apache-2.0"
] | null | null | null | tests/TestAptChefProvisionerPlugin.py | dhellmann/aminator | 96efa7d5690bfae2c20b21f0b417b2784f6cb085 | [
"Apache-2.0"
] | null | null | null | tests/TestAptChefProvisionerPlugin.py | dhellmann/aminator | 96efa7d5690bfae2c20b21f0b417b2784f6cb085 | [
"Apache-2.0"
] | 1 | 2020-01-06T16:18:22.000Z | 2020-01-06T16:18:22.000Z | # -*- coding: utf-8 -*-
#
#
# Copyright 2013 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 41.573529 | 114 | 0.710294 |
import logging
import json
from aminator.config import Config
from aminator.plugins.provisioner.apt_chef import AptChefProvisionerPlugin
log = logging.getLogger(__name__)
console = logging.StreamHandler()
logging.getLogger('').addHandler(console)
class TestAptChefProvisionerPlugin(object):
... | true | true |
f71742c671520b22e56777c333e9e3fd20648561 | 2,331 | py | Python | tests/models/validators/v1_3_0/jsd_d9bdb9034df99dba.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 32 | 2019-09-05T05:16:56.000Z | 2022-03-22T09:50:38.000Z | tests/models/validators/v1_3_0/jsd_d9bdb9034df99dba.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 35 | 2019-09-07T18:58:54.000Z | 2022-03-24T19:29:36.000Z | tests/models/validators/v1_3_0/jsd_d9bdb9034df99dba.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 18 | 2019-09-09T11:07:21.000Z | 2022-03-25T08:49:59.000Z | # -*- coding: utf-8 -*-
"""Cisco DNA Center Get Site Count data model.
Copyright (c) 2019-2021 Cisco Systems.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including withou... | 32.830986 | 78 | 0.639211 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import fastjsonschema
import json
from dnacentersdk.exceptions import MalformedRequest
from builtins import *
class JSONSchemaValidatorD9BdB9034Df99Dba(object):
def __init__(self):
super(JSONSchema... | true | true |
f71744883794a583ccf9436508cd8c98a384800a | 1,579 | py | Python | artascope/test/lib/test_user_status_manager.py | magus0219/icloud-photo-downloader | 6334530d971cf61089d031de99a38f204c201837 | [
"MIT"
] | 3 | 2020-09-24T16:19:28.000Z | 2022-02-09T21:10:11.000Z | artascope/test/lib/test_user_status_manager.py | magus0219/icloud-photo-downloader | 6334530d971cf61089d031de99a38f204c201837 | [
"MIT"
] | null | null | null | artascope/test/lib/test_user_status_manager.py | magus0219/icloud-photo-downloader | 6334530d971cf61089d031de99a38f204c201837 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created by magus0219[magus0219@gmail.com] on 2020/3/30
import datetime
from artascope.src.lib.user_status_manager import usm
class TestUserStatusManager:
def test_add_user(self):
usm.add_user(username="username")
us = usm.get_user(username="usern... | 28.709091 | 67 | 0.636479 |
import datetime
from artascope.src.lib.user_status_manager import usm
class TestUserStatusManager:
def test_add_user(self):
usm.add_user(username="username")
us = usm.get_user(username="username")
assert (
us.username == "username"
and type(us.created_ts) == in... | true | true |
f7174560bad50e0fdbb28b5776553cba721ab30f | 2,919 | py | Python | swagger_client/models/all_of_permission_set_administration_rights.py | ike709/tgs4-api-pyclient | 97918cfe614cc4ef06ef2485efff163417a8cd44 | [
"MIT"
] | null | null | null | swagger_client/models/all_of_permission_set_administration_rights.py | ike709/tgs4-api-pyclient | 97918cfe614cc4ef06ef2485efff163417a8cd44 | [
"MIT"
] | null | null | null | swagger_client/models/all_of_permission_set_administration_rights.py | ike709/tgs4-api-pyclient | 97918cfe614cc4ef06ef2485efff163417a8cd44 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
TGS API
A production scale tool for BYOND server management # noqa: E501
OpenAPI spec version: 9.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from swagger_client.models.administration_rights impor... | 32.076923 | 95 | 0.59815 |
import pprint
import re
import six
from swagger_client.models.administration_rights import AdministrationRights
class AllOfPermissionSetAdministrationRights(AdministrationRights):
swagger_types = {
}
if hasattr(AdministrationRights, "swagger_types"):
swagger_types.update(AdministrationRight... | true | true |
f71747aaed07f08c55da22df67f2dc5bc6ae9a92 | 742 | py | Python | ocr/paint.py | BumagniyPacket/ocr | f2651f3a23cf835a689b35a658ef3443086fd72a | [
"Apache-2.0"
] | null | null | null | ocr/paint.py | BumagniyPacket/ocr | f2651f3a23cf835a689b35a658ef3443086fd72a | [
"Apache-2.0"
] | null | null | null | ocr/paint.py | BumagniyPacket/ocr | f2651f3a23cf835a689b35a658ef3443086fd72a | [
"Apache-2.0"
] | 1 | 2019-02-07T19:56:33.000Z | 2019-02-07T19:56:33.000Z | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
def show_image(image):
plt.imshow(-image, cmap='Greys')
plt.show()
def show_two(image1, image2):
plt.subplot(121)
plt.imshow(-image1, cmap='Greys')
plt.subplot(122)
plt.imshow(-image2, cmap='Greys')
plt.show()
def plot_hist(img)... | 18.55 | 62 | 0.610512 |
import matplotlib.pyplot as plt
def show_image(image):
plt.imshow(-image, cmap='Greys')
plt.show()
def show_two(image1, image2):
plt.subplot(121)
plt.imshow(-image1, cmap='Greys')
plt.subplot(122)
plt.imshow(-image2, cmap='Greys')
plt.show()
def plot_hist(img):
plt.hist(img.rave... | true | true |
f7174853e5691cb8f3c8388d4ff3c6a48d541046 | 21,576 | py | Python | gpMgmt/bin/gppylib/commands/base.py | abhisheknishant138/gpdb | 1805743d505837026aa137cabb8a7072d745a129 | [
"PostgreSQL",
"Apache-2.0"
] | 4 | 2017-11-28T08:12:58.000Z | 2020-10-28T04:15:52.000Z | gpMgmt/bin/gppylib/commands/base.py | abhisheknishant138/gpdb | 1805743d505837026aa137cabb8a7072d745a129 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/commands/base.py | abhisheknishant138/gpdb | 1805743d505837026aa137cabb8a7072d745a129 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
"""
base.py
common base for the commands execution framework. Units of work are defined as Operations
as found in other modules like unix.py. These units of work are then packaged up and executed
within a GpCommand. A GpCommand is j... | 33.451163 | 116 | 0.612023 |
from queue import Queue, Empty
from threading import Thread
import os
import signal
import subprocess
import sys
import time
from gppylib import gplog
from gppylib import gpsubprocess
from pg import DB
logger = gplog.get_default_logger()
GPHOME = os.environ.get('GPHOME')
SSH_MAX_RETRY = 10
SSH_RETRY_DELAY... | true | true |
f71748e77f76da11ab56b956f1c6463063b71ea1 | 1,609 | py | Python | main.py | manulaiko/ulauncher-openInBrowser | 2536813431253f4711a950b50669d1bb6f842de4 | [
"MIT"
] | 1 | 2020-06-10T10:34:05.000Z | 2020-06-10T10:34:05.000Z | main.py | manulaiko/ulauncher-openInBrowser | 2536813431253f4711a950b50669d1bb6f842de4 | [
"MIT"
] | 6 | 2018-01-26T10:04:02.000Z | 2020-09-07T17:09:07.000Z | main.py | manulaiko/ulauncher-openInBrowser | 2536813431253f4711a950b50669d1bb6f842de4 | [
"MIT"
] | 5 | 2018-03-24T09:35:38.000Z | 2020-11-02T03:42:09.000Z | from ulauncher.api.client.Extension import Extension
from ulauncher.api.shared.action.ExtensionCustomAction import ExtensionCustomAction
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.event import KeywordQueryEvent, ItemEnterEvent
from ulauncher.api.shared.item.ExtensionResultIte... | 34.234043 | 85 | 0.712244 | from ulauncher.api.client.Extension import Extension
from ulauncher.api.shared.action.ExtensionCustomAction import ExtensionCustomAction
from ulauncher.api.client.EventListener import EventListener
from ulauncher.api.shared.event import KeywordQueryEvent, ItemEnterEvent
from ulauncher.api.shared.item.ExtensionResultIte... | true | true |
f7174a07455b8d2615386130e8a5a7f7b941d1ab | 1,222 | py | Python | setup.py | Shravan-1908/pyscreenrec | 286c1a24c95918353388007e3c7fcd23d404ba8f | [
"MIT"
] | 15 | 2021-02-11T16:29:28.000Z | 2021-09-11T14:17:19.000Z | setup.py | Shravan-1908/pyscreenrec | 286c1a24c95918353388007e3c7fcd23d404ba8f | [
"MIT"
] | 2 | 2021-02-26T17:38:32.000Z | 2021-05-19T17:58:34.000Z | setup.py | Shravan-1908/pyscreenrec | 286c1a24c95918353388007e3c7fcd23d404ba8f | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
VERSION = 0.4
with open("README.md") as f:
README = f.read()
setup(
name = "pyscreenrec",
version = VERSION,
description = "A small and cross-platform python library for recording screen.",
long_description_content_type = "text/markdown",
long_descri... | 37.030303 | 84 | 0.626023 | from setuptools import find_packages, setup
VERSION = 0.4
with open("README.md") as f:
README = f.read()
setup(
name = "pyscreenrec",
version = VERSION,
description = "A small and cross-platform python library for recording screen.",
long_description_content_type = "text/markdown",
long_descri... | true | true |
f7174a5077e5e6d8533019e51bf2c5b67b88f10b | 984 | py | Python | python-dtf/tests/integration/prop/test_prop_dump.py | jakev/dtf | a761ace77cea051bfb88d56df65ae6b83f664480 | [
"Apache-2.0"
] | 58 | 2015-01-13T16:24:31.000Z | 2016-11-21T16:00:58.000Z | python-dtf/tests/integration/prop/test_prop_dump.py | jakev/dtf | a761ace77cea051bfb88d56df65ae6b83f664480 | [
"Apache-2.0"
] | 51 | 2015-03-11T20:42:21.000Z | 2017-01-18T02:49:10.000Z | python-dtf/tests/integration/prop/test_prop_dump.py | jakev/dtf | a761ace77cea051bfb88d56df65ae6b83f664480 | [
"Apache-2.0"
] | 15 | 2016-02-01T00:37:21.000Z | 2016-12-09T07:03:36.000Z | # Android Device Testing Framework ("dtf")
# Copyright 2013-2016 Jake Valletta (@jake_valletta)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | 29.818182 | 74 | 0.748984 |
from __future__ import absolute_import
import dtf.testutils as testutils
def test_no_args():
testutils.deploy_config(testutils.get_default_config())
rtn = testutils.dtf("prop dump")
testutils.undeploy()
assert(rtn.return_code == 0)
| true | true |
f7174c3b69586ad7a0dd822a81cded6f137b0e87 | 1,204 | py | Python | tests/integration/test_tmp_policy/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 15,577 | 2019-09-23T11:57:53.000Z | 2022-03-31T18:21:48.000Z | tests/integration/test_tmp_policy/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 16,476 | 2019-09-23T11:47:00.000Z | 2022-03-31T23:06:01.000Z | tests/integration/test_tmp_policy/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 3,633 | 2019-09-23T12:18:28.000Z | 2022-03-31T15:55:48.000Z | # pylint: disable=unused-argument
# pylint: disable=redefined-outer-name
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node',
main_configs=["configs/config.d/storage_configuration.xml"],
... | 32.540541 | 99 | 0.69186 |
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node',
main_configs=["configs/config.d/storage_configuration.xml"],
tmpfs=['/disk1:size=100M', '/disk2:size=100M'])
@pytest.fixtu... | true | true |
f7174ca5b3715337bd66e103f422e337ca016408 | 492 | py | Python | Home/migrations/0006_auto_20201005_2114.py | n3trob3/nimrodage | 578eb14e2e8f7dc7ae58913b6131fd60c1596c0b | [
"Apache-2.0"
] | null | null | null | Home/migrations/0006_auto_20201005_2114.py | n3trob3/nimrodage | 578eb14e2e8f7dc7ae58913b6131fd60c1596c0b | [
"Apache-2.0"
] | null | null | null | Home/migrations/0006_auto_20201005_2114.py | n3trob3/nimrodage | 578eb14e2e8f7dc7ae58913b6131fd60c1596c0b | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.1 on 2020-10-05 20:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Home', '0005_auto_20201005_2107'),
]
operations = [
migrations.AlterField(
model_name='contact',
name=... | 25.894737 | 140 | 0.571138 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Home', '0005_auto_20201005_2107'),
]
operations = [
migrations.AlterField(
model_name='contact',
name='meeting',
field=models.CharField(b... | true | true |
f7174cab91de04cda9ea71e938b27612f1038cb9 | 11,857 | py | Python | tests/test_stochatreat_assignment.py | RoyalTS/stochatreat | 6e638e748b8638b64a185229f78967cf864cd45e | [
"MIT"
] | null | null | null | tests/test_stochatreat_assignment.py | RoyalTS/stochatreat | 6e638e748b8638b64a185229f78967cf864cd45e | [
"MIT"
] | 13 | 2019-07-11T13:13:39.000Z | 2019-07-19T14:26:57.000Z | tests/test_stochatreat_assignment.py | RoyalTS/stochatreat | 6e638e748b8638b64a185229f78967cf864cd45e | [
"MIT"
] | null | null | null | import pytest
from math import gcd
import numpy as np
import pandas as pd
from stochatreat import stochatreat
from stochatreat import get_lcm_prob_denominators
################################################################################
# fixtures
###############################################################... | 30.017722 | 80 | 0.627899 | import pytest
from math import gcd
import numpy as np
import pandas as pd
from stochatreat import stochatreat
from stochatreat import get_lcm_prob_denominators
| true | true |
f7174cd8c1d5c09c4cbcb9df7c5490a9c0982657 | 1,305 | py | Python | source/ship.py | seveirbian/Plane-game | 96c5377e72d3dfb1c5720a1769e9db8e89624ed5 | [
"MIT"
] | 1 | 2018-06-12T08:56:52.000Z | 2018-06-12T08:56:52.000Z | source/ship.py | seveirbian/Plane-game | 96c5377e72d3dfb1c5720a1769e9db8e89624ed5 | [
"MIT"
] | null | null | null | source/ship.py | seveirbian/Plane-game | 96c5377e72d3dfb1c5720a1769e9db8e89624ed5 | [
"MIT"
] | null | null | null | import pygame
from pygame.sprite import Sprite
class Ship(Sprite):
def __init__(self, ai_settings, screen):
super().__init__()
'''初始化飞船并设置其初始位置'''
self.screen = screen
self.ai_settings = ai_settings
# 加载飞船图像并获取其外接矩形
self.image = pygame.image.load('../images/ship.png... | 29 | 76 | 0.622989 | import pygame
from pygame.sprite import Sprite
class Ship(Sprite):
def __init__(self, ai_settings, screen):
super().__init__()
self.screen = screen
self.ai_settings = ai_settings
self.image = pygame.image.load('../images/ship.png')
self.rect = self.image.get_rect()... | true | true |
f7174db2dec152988a0f2418273a7a9086488a8b | 4,836 | py | Python | pynubank/nubank.py | FlavioMoreiraTec/nubank-flavio | 224f483a7c7644116657c4f9e0929010ed511aa4 | [
"MIT"
] | null | null | null | pynubank/nubank.py | FlavioMoreiraTec/nubank-flavio | 224f483a7c7644116657c4f9e0929010ed511aa4 | [
"MIT"
] | null | null | null | pynubank/nubank.py | FlavioMoreiraTec/nubank-flavio | 224f483a7c7644116657c4f9e0929010ed511aa4 | [
"MIT"
] | null | null | null | import json
import os
import uuid
from typing import Tuple
import requests
from qrcode import QRCode
from requests import Response
PAYMENT_EVENT_TYPES = (
'TransferOutEvent',
'TransferInEvent',
'TransferOutReversalEvent',
'BarcodePaymentEvent',
'DebitPurchaseEvent',
'DebitPurchaseReversalEvent... | 35.29927 | 101 | 0.651778 | import json
import os
import uuid
from typing import Tuple
import requests
from qrcode import QRCode
from requests import Response
PAYMENT_EVENT_TYPES = (
'TransferOutEvent',
'TransferInEvent',
'TransferOutReversalEvent',
'BarcodePaymentEvent',
'DebitPurchaseEvent',
'DebitPurchaseReversalEvent... | true | true |
f7174f069101d37e1152c091948b84f7ddc5aa8d | 313 | py | Python | py_merge/mergeexample.py | mutazag/misc | dfef362cdd835ef4efd1f2d02e13ff5297ccfc0f | [
"MIT"
] | null | null | null | py_merge/mergeexample.py | mutazag/misc | dfef362cdd835ef4efd1f2d02e13ff5297ccfc0f | [
"MIT"
] | null | null | null | py_merge/mergeexample.py | mutazag/misc | dfef362cdd835ef4efd1f2d02e13ff5297ccfc0f | [
"MIT"
] | null | null | null | #%%
import pandas as pd
#%%
df1 = pd.read_csv('df1.csv', index_col=0)
# %%
df2 = pd.read_csv('df2.csv', index_col=0)
# %%
df3 = pd.read_csv('df3.csv', index_col=0)
# %%
df1.merge(df2, on='proj_id').merge(df3, on='doc_id')
# %%
df1.merge(df2, on='proj_id', how='left').merge(df3, on='doc_id', how='left')
# %%
| 18.411765 | 76 | 0.603834 |
import pandas as pd
df1 = pd.read_csv('df1.csv', index_col=0)
df2 = pd.read_csv('df2.csv', index_col=0)
df3 = pd.read_csv('df3.csv', index_col=0)
df1.merge(df2, on='proj_id').merge(df3, on='doc_id')
df1.merge(df2, on='proj_id', how='left').merge(df3, on='doc_id', how='left')
| true | true |
f7175023ba297508308f5f971d92777633745cb2 | 1,542 | py | Python | tests/python/gaia-ui-tests/gaiatest/tests/functional/settings/test_settings_media_storage.py | BReduardokramer/gaia | c00302cdcd435ab193e8365917cfc6abac9e4f2e | [
"Apache-2.0"
] | 1 | 2021-11-09T00:27:34.000Z | 2021-11-09T00:27:34.000Z | tests/python/gaia-ui-tests/gaiatest/tests/functional/settings/test_settings_media_storage.py | Delphine/gaia | df92f0ebd89efbc63570a61e70c4304c17b8b555 | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/tests/functional/settings/test_settings_media_storage.py | Delphine/gaia | df92f0ebd89efbc63570a61e70c4304c17b8b555 | [
"Apache-2.0"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
from gaiatest.apps.settings.app import Settings
class TestSettingsMediaStorage(GaiaT... | 40.578947 | 80 | 0.72179 |
from gaiatest import GaiaTestCase
from gaiatest.apps.settings.app import Settings
class TestSettingsMediaStorage(GaiaTestCase):
def test_settings_media_storage(self):
settings = Settings(self.marionette)
settings.launch()
media_storage_settings = settings.open_media_storage_settings(... | true | true |
f71752ad85213d316ee14113c2e19d7243632bd1 | 17,836 | py | Python | features/eolearn/features/radiometric_normalization.py | mohammadrezabk/eo-learn | 8de3cfd64e74c1e4832e585954cdbf0ee9676eb3 | [
"MIT"
] | null | null | null | features/eolearn/features/radiometric_normalization.py | mohammadrezabk/eo-learn | 8de3cfd64e74c1e4832e585954cdbf0ee9676eb3 | [
"MIT"
] | null | null | null | features/eolearn/features/radiometric_normalization.py | mohammadrezabk/eo-learn | 8de3cfd64e74c1e4832e585954cdbf0ee9676eb3 | [
"MIT"
] | null | null | null | """
Module for radiometric normalization
Credits:
Copyright (c) 2018-2019 Johannes Schmid (GeoVille)
Copyright (c) 2017-2019 Matej Aleksandrov, Matic Lubej, Devis Peresutti (Sinergise)
This source code is licensed under the MIT license found in the LICENSE
file in the root directory of this source tree.
"""
import n... | 46.569191 | 120 | 0.655808 |
import numpy as np
from eolearn.core import EOTask, FeatureType
class ReferenceScenes(EOTask):
def __init__(self, feature, valid_fraction_feature, max_scene_number=None):
self.feature = self._parse_features(feature, new_names=True,
default_feature_type=Feature... | true | true |
f71754673dd76b5b137364e722d76f8cba4d6ce8 | 3,160 | py | Python | pypureclient/flasharray/FA_2_11/models/software_bundle_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_11/models/software_bundle_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_11/models/software_bundle_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.11
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from ... | 28.214286 | 105 | 0.549051 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_11 import models
class SoftwareBundleResponse(object):
swagger_types = {
'items': 'list[SoftwareBundle]'
}
attribute_map = {
'items': 'i... | true | true |
f7175555296b859086cc2c753888bdfe21cb502e | 936 | py | Python | deoldify/save.py | TaktakTaktouk/DeOldify | 0ff6139bb09d0abdf535a724f05bdad3ec04dcc1 | [
"MIT"
] | 14,898 | 2018-11-01T14:48:38.000Z | 2022-03-31T16:28:38.000Z | deoldify/save.py | TaktakTaktouk/DeOldify | 0ff6139bb09d0abdf535a724f05bdad3ec04dcc1 | [
"MIT"
] | 376 | 2018-11-02T18:22:23.000Z | 2022-03-24T21:29:19.000Z | deoldify/save.py | TaktakTaktouk/DeOldify | 0ff6139bb09d0abdf535a724f05bdad3ec04dcc1 | [
"MIT"
] | 2,250 | 2018-11-02T15:45:39.000Z | 2022-03-28T17:08:23.000Z | from fastai.basic_train import Learner, LearnerCallback
from fastai.vision.gan import GANLearner
class GANSaveCallback(LearnerCallback):
"""A `LearnerCallback` that saves history of metrics while training `learn` into CSV `filename`."""
def __init__(
self,
learn: GANLearner,
learn_gen... | 31.2 | 103 | 0.645299 | from fastai.basic_train import Learner, LearnerCallback
from fastai.vision.gan import GANLearner
class GANSaveCallback(LearnerCallback):
def __init__(
self,
learn: GANLearner,
learn_gen: Learner,
filename: str,
save_iters: int = 1000,
):
super().__init__(learn)... | true | true |
f71756f9227d14924ce1c8f11117e55a80ba40c0 | 1,904 | py | Python | tests/test_args.py | rauljim/passgen | ca55c08b1ab0439d598dc045982b6971bfee1629 | [
"MIT"
] | null | null | null | tests/test_args.py | rauljim/passgen | ca55c08b1ab0439d598dc045982b6971bfee1629 | [
"MIT"
] | null | null | null | tests/test_args.py | rauljim/passgen | ca55c08b1ab0439d598dc045982b6971bfee1629 | [
"MIT"
] | null | null | null | from passgen import args
def test_num_words():
mock_argv = ['passgen', '-n', '22']
options = args.get_cli_options(mock_argv)
assert 22 == options.num_words
mock_argv = ['passgen', '--num-words', '33']
options = args.get_cli_options(mock_argv)
assert 33 == options.num_words
mock_argv = ['pa... | 32.271186 | 71 | 0.688025 | from passgen import args
def test_num_words():
mock_argv = ['passgen', '-n', '22']
options = args.get_cli_options(mock_argv)
assert 22 == options.num_words
mock_argv = ['passgen', '--num-words', '33']
options = args.get_cli_options(mock_argv)
assert 33 == options.num_words
mock_argv = ['pa... | true | true |
f717576ebe1b232b2fdba0695ea262b2ae5063cc | 2,568 | py | Python | src/base/base_train.py | MohamedAli1995/Cifar-100-Classifier | 924704a81ce13062825a88b90b80e8ac2ba45d63 | [
"MIT"
] | 2 | 2019-05-12T16:11:20.000Z | 2020-04-10T22:39:57.000Z | src/base/base_train.py | MohamedAli1995/Cifar-100-Classifier | 924704a81ce13062825a88b90b80e8ac2ba45d63 | [
"MIT"
] | null | null | null | src/base/base_train.py | MohamedAli1995/Cifar-100-Classifier | 924704a81ce13062825a88b90b80e8ac2ba45d63 | [
"MIT"
] | null | null | null | import tensorflow as tf
class BaseTrain:
"""Standard base_train-class for easy multiple-inheritance.
It is responsible for defining the functions to be implemented with any child.
Attributes:
sess: Tensorflow session to use.
model: Model to be trained.
data: Data_loader object... | 36.169014 | 115 | 0.640576 | import tensorflow as tf
class BaseTrain:
def __init__(self, sess, model, data, config, logger):
self.model = model
self.config = config
self.sess = sess
self.data = data
self.logger = logger
if not self.config.pretrain:
self.init = tf.group(tf.global_... | true | true |
f7175782c5dfa546dd124965a86fa50da687c7ac | 1,267 | py | Python | SIGNUS/app/api/signus_v1/post.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | SIGNUS/app/api/signus_v1/post.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | SIGNUS/app/api/signus_v1/post.py | 837477/SIGNUS | cd395dfd45d2c36d09ec9a8069e6e52e19f058e8 | [
"MIT"
] | null | null | null | '''
SIGNUS V1 post API
'''
from flask import g
from app.api.signus_v1 import signus_v1 as api
from app.api.decorators import timer, login_required, login_optional
from app.controllers.post import (post_like,
post_unlike,
post_view)
@api.route("/post/... | 24.843137 | 68 | 0.556433 | from flask import g
from app.api.signus_v1 import signus_v1 as api
from app.api.decorators import timer, login_required, login_optional
from app.controllers.post import (post_like,
post_unlike,
post_view)
@api.route("/post/like/<string:post_oid>", me... | true | true |
f71759ee5d329c4385a20b4d6bd880bfb741c347 | 1,398 | py | Python | migrations/versions/f0a99f6b5e5e_.py | CSCfi/pebbles | 24b32e8fc538cc8095fda62c892a8221346c2bce | [
"MIT"
] | 4 | 2017-05-11T14:50:32.000Z | 2020-01-10T09:02:27.000Z | migrations/versions/f0a99f6b5e5e_.py | CSCfi/pebbles | 24b32e8fc538cc8095fda62c892a8221346c2bce | [
"MIT"
] | 145 | 2017-04-07T11:01:58.000Z | 2019-12-11T15:30:23.000Z | migrations/versions/f0a99f6b5e5e_.py | CSCfi/pebbles | 24b32e8fc538cc8095fda62c892a8221346c2bce | [
"MIT"
] | 3 | 2017-10-25T12:36:16.000Z | 2018-04-26T08:49:34.000Z | """empty message
Revision ID: f0a99f6b5e5e
Revises: he536vdwh29f
Create Date: 2019-05-31 15:57:36.032393
"""
# revision identifiers, used by Alembic.
revision = 'f0a99f6b5e5e'
down_revision = 'he536vdwh29f'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | 35.846154 | 118 | 0.700286 |
revision = 'f0a99f6b5e5e'
down_revision = 'he536vdwh29f'
from alembic import op
import sqlalchemy as sa
def upgrade():
ance_id', sa.String(length=32), nullable=True),
sa.Column('expires_on', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['instance_id'], ['instances.id'], name=op.f('fk_instance... | true | true |
f71759fb13c6dffdc6c632f41e1c01f82a06b50a | 103,166 | py | Python | python/pyarrow/tests/test_parquet.py | sparkma/arrow | 62fd703a4ef0abbecb02397a06a630a9dee382d9 | [
"Apache-2.0"
] | null | null | null | python/pyarrow/tests/test_parquet.py | sparkma/arrow | 62fd703a4ef0abbecb02397a06a630a9dee382d9 | [
"Apache-2.0"
] | null | null | null | python/pyarrow/tests/test_parquet.py | sparkma/arrow | 62fd703a4ef0abbecb02397a06a630a9dee382d9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "... | 32.513709 | 79 | 0.627494 |
from collections import OrderedDict
import datetime
import decimal
import io
import json
import os
import six
import pickle
import pytest
import numpy as np
import pyarrow as pa
from pyarrow.compat import guid, u, BytesIO, unichar, PY2
from pyarrow.pandas_compat import _pandas_api
from pyarrow.tests... | true | true |
f7175c38c11862b31ec72a419e525c555b34bcf3 | 16,570 | py | Python | batch/processor_BondLedger_JP.py | BoostryJP/ibet-Issuer | efc599f8784be06588cf3ad8f239d36f24fdf3fa | [
"Apache-2.0"
] | 1 | 2021-06-16T03:38:07.000Z | 2021-06-16T03:38:07.000Z | batch/processor_BondLedger_JP.py | BoostryJP/ibet-Issuer | efc599f8784be06588cf3ad8f239d36f24fdf3fa | [
"Apache-2.0"
] | 17 | 2021-04-26T03:28:40.000Z | 2021-11-24T07:15:55.000Z | batch/processor_BondLedger_JP.py | BoostryJP/ibet-Issuer | efc599f8784be06588cf3ad8f239d36f24fdf3fa | [
"Apache-2.0"
] | 1 | 2021-05-30T14:09:11.000Z | 2021-05-30T14:09:11.000Z | """
Copyright BOOSTRY Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distr... | 34.957806 | 120 | 0.559626 | import base64
from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
from datetime import (
datetime,
timezone,
timedelta
)
import json
import os
import sys
import time
from eth_utils import to_checksum_address
from sqlalchemy import (
create_engine,
func
)
from sqlalchemy.orm import... | true | true |
f7175d22337c8b28777d73b05a950345e75f3ce4 | 1,993 | py | Python | app/forms.py | TimothyBenger/top_lists | b3b5895a3a3c525e81fe167eb7d7ba46cfcbd785 | [
"MIT"
] | null | null | null | app/forms.py | TimothyBenger/top_lists | b3b5895a3a3c525e81fe167eb7d7ba46cfcbd785 | [
"MIT"
] | null | null | null | app/forms.py | TimothyBenger/top_lists | b3b5895a3a3c525e81fe167eb7d7ba46cfcbd785 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, IntegerField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo
from app.models import User
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(... | 44.288889 | 87 | 0.714501 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, IntegerField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo
from app.models import User
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(... | true | true |
f7175d5c72e50e87ef42937e0544adccadf5efa8 | 452 | py | Python | lidi/signup/migrations/0002_user_conf_link.py | campovski/lidi | 9699e62e70e679970816e29ca7618c9ed0146c7e | [
"Apache-2.0"
] | null | null | null | lidi/signup/migrations/0002_user_conf_link.py | campovski/lidi | 9699e62e70e679970816e29ca7618c9ed0146c7e | [
"Apache-2.0"
] | 21 | 2017-06-03T14:16:14.000Z | 2018-05-29T07:28:27.000Z | lidi/signup/migrations/0002_user_conf_link.py | campovski/lidi | 9699e62e70e679970816e29ca7618c9ed0146c7e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-02 18:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('signup', '0001_initial'),
]
operations = [
migrations.AddField(
... | 21.52381 | 64 | 0.606195 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('signup', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='conf_link',
field=mod... | true | true |
f7175d75f291571b61c64c017b95e8592d28ea76 | 424 | py | Python | app/moviestore/migrations/0007_alter_movie_user_charge.py | GeorgiosDolias/Movie-Store-REST-API | 3a07301e4574071d6edb00d1a8b2c266c1fc8ff1 | [
"MIT"
] | null | null | null | app/moviestore/migrations/0007_alter_movie_user_charge.py | GeorgiosDolias/Movie-Store-REST-API | 3a07301e4574071d6edb00d1a8b2c266c1fc8ff1 | [
"MIT"
] | null | null | null | app/moviestore/migrations/0007_alter_movie_user_charge.py | GeorgiosDolias/Movie-Store-REST-API | 3a07301e4574071d6edb00d1a8b2c266c1fc8ff1 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-11-05 00:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('moviestore', '0006_movie_user_charge'),
]
operations = [
migrations.AlterField(
model_name='movie',
name='user_charg... | 22.315789 | 82 | 0.620283 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('moviestore', '0006_movie_user_charge'),
]
operations = [
migrations.AlterField(
model_name='movie',
name='user_charge',
field=models.DecimalField(blank... | true | true |
f7175f33e2db2534a03ad6bfb8c47d7e1b04f568 | 486 | py | Python | main/strings/slice/words.py | catalinprescure/python-pages | 93df3b22df2cfa269127e803a1b6c6a34bae6745 | [
"MIT"
] | null | null | null | main/strings/slice/words.py | catalinprescure/python-pages | 93df3b22df2cfa269127e803a1b6c6a34bae6745 | [
"MIT"
] | null | null | null | main/strings/slice/words.py | catalinprescure/python-pages | 93df3b22df2cfa269127e803a1b6c6a34bae6745 | [
"MIT"
] | 1 | 2021-12-24T15:58:32.000Z | 2021-12-24T15:58:32.000Z | # Open file and search through words list
# Return number of words with no e in them
import os
file = os.path.dirname(__file__) + "/words.txt"
rows = open(file)
def has_no_e(word):
for letter in word:
if letter == "e":
return False
return True
W = [] # words
E = [] # word with no e
for ... | 18.692308 | 47 | 0.584362 |
import os
file = os.path.dirname(__file__) + "/words.txt"
rows = open(file)
def has_no_e(word):
for letter in word:
if letter == "e":
return False
return True
W = []
E = []
for row in rows:
word = row.strip()
W.append(word)
if (has_no_e(word)):
E.append(word)
... | true | true |
f717606f6302397f6adbcd4ea5ca8a1e1e665802 | 374 | py | Python | setup.py | adamjoshuagray/PredictItPy | 4006cb00f38c256765b556b3476c286470555533 | [
"MIT"
] | null | null | null | setup.py | adamjoshuagray/PredictItPy | 4006cb00f38c256765b556b3476c286470555533 | [
"MIT"
] | 1 | 2016-11-08T10:02:31.000Z | 2016-11-08T10:02:31.000Z | setup.py | adamjoshuagray/PredictItPy | 4006cb00f38c256765b556b3476c286470555533 | [
"MIT"
] | 1 | 2019-07-04T10:53:41.000Z | 2019-07-04T10:53:41.000Z | from setuptools import setup
setup(name='predictitpy',
version='0.2',
py_modules=['predictitpy'],
description='A very light wrapper around the PredictIt.org market data api.',
url='https://github.com/adamjoshuagray/predictitpy',
author='Adam J. Gray',
author_email='adam.joshua.gray@... | 34 | 83 | 0.671123 | from setuptools import setup
setup(name='predictitpy',
version='0.2',
py_modules=['predictitpy'],
description='A very light wrapper around the PredictIt.org market data api.',
url='https://github.com/adamjoshuagray/predictitpy',
author='Adam J. Gray',
author_email='adam.joshua.gray@... | true | true |
f71763968b7433700606cc9fe3afcf0b874429db | 129,676 | py | Python | salt/ext/tornado/web.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | salt/ext/tornado/web.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/ext/tornado/web.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.439173 | 153 | 0.61757 |
from __future__ import absolute_import, division, print_function
import base64
import binascii
import datetime
import email.utils
import functools
import gzip
import hashlib
import hmac
import mimetypes
import numbers
import os.path
import re
import stat
import sys
import threading
import time
import... | true | true |
f717643a746a127d6805e12ee1e2871ece59b391 | 231 | py | Python | replacefs/colors.py | yoarch/replace | 5255810c019141f7de03b96c26a9b732d2218597 | [
"MIT"
] | null | null | null | replacefs/colors.py | yoarch/replace | 5255810c019141f7de03b96c26a9b732d2218597 | [
"MIT"
] | null | null | null | replacefs/colors.py | yoarch/replace | 5255810c019141f7de03b96c26a9b732d2218597 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
RED = '\033[38;5;196;1m'
ORANGE = '\033[38;5;202;1m'
WHITE = '\033[1;37m'
BLUE = '\033[1;34m'
BASE_C = '\033[0m'
GREEN = '\033[38;5;40;1m'
PURPLE = '\033[38;5;135;1m'
GREY = '\033[1;30m'
YELLOW = '\033[1;33m'
| 21 | 27 | 0.588745 |
RED = '\033[38;5;196;1m'
ORANGE = '\033[38;5;202;1m'
WHITE = '\033[1;37m'
BLUE = '\033[1;34m'
BASE_C = '\033[0m'
GREEN = '\033[38;5;40;1m'
PURPLE = '\033[38;5;135;1m'
GREY = '\033[1;30m'
YELLOW = '\033[1;33m'
| true | true |
f7176531240df0f77d476afe1bbca902bbc7bc3d | 2,864 | py | Python | src/assets/sd_vaccine_plots/main.py | drvinceknight/amwoss | 8b0bf80f0a06dc5cf9bfeef4b9f9e174ccadf06d | [
"MIT"
] | 1 | 2022-03-21T21:35:44.000Z | 2022-03-21T21:35:44.000Z | src/assets/sd_vaccine_plots/main.py | drvinceknight/amwoss | 8b0bf80f0a06dc5cf9bfeef4b9f9e174ccadf06d | [
"MIT"
] | 71 | 2019-11-18T11:00:25.000Z | 2021-10-21T22:49:40.000Z | src/assets/sd_vaccine_plots/main.py | drvinceknight/amwoss | 8b0bf80f0a06dc5cf9bfeef4b9f9e174ccadf06d | [
"MIT"
] | 1 | 2020-01-15T12:00:49.000Z | 2020-01-15T12:00:49.000Z | from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
def derivatives(t, y, vaccine_rate, birth_rate=0.01):
"""Defines the system of differential equations that
describe the epidemiology model.
Args:
t: a positive float
y: a tuple of three... | 31.822222 | 80 | 0.62081 | from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
def derivatives(t, y, vaccine_rate, birth_rate=0.01):
infection_rate = 0.3
recovery_rate = 0.02
death_rate = 0.01
S, I, R = y
N = S + I + R
dSdt = (
-((infection_rate * S * I) / N)
... | true | true |
f717657e62b89fc8eff399b8be1e18a4646e310b | 8,981 | py | Python | alipay/aop/api/request/AlipayOpenServicemarketOrderCreateRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayOpenServicemarketOrderCreateRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayOpenServicemarketOrderCreateRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenServicemarketOrderCreateRequest(object):
def __init__(self, biz_model=None):
self._biz_model = biz_model
sel... | 33.262963 | 176 | 0.635119 |
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenServicemarketOrderCreateRequest(object):
def __init__(self, biz_model=None):
self._biz_model = biz_model
self._app_category_ids = None
self._app... | true | true |
f71767ca2c739f1474e2622061bcec8545048d82 | 18,990 | py | Python | plugins/modules/oci_opsi_resource_forecast_trend_facts.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_opsi_resource_forecast_trend_facts.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_opsi_resource_forecast_trend_facts.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 38.99384 | 157 | 0.597999 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_opsi_resource_forecast_trend_facts
short_description: Fetches details ab... | true | true |
f71767d27ceb9c0a11fa4ade0519de1ef382cf0f | 1,385 | py | Python | 2020/src/day6.py | vionion/advent-of-code-2019 | c3389694a42e9b1d978f82c6fb42925465799734 | [
"MIT"
] | null | null | null | 2020/src/day6.py | vionion/advent-of-code-2019 | c3389694a42e9b1d978f82c6fb42925465799734 | [
"MIT"
] | null | null | null | 2020/src/day6.py | vionion/advent-of-code-2019 | c3389694a42e9b1d978f82c6fb42925465799734 | [
"MIT"
] | null | null | null | from typing import List, Set
from io_utils import read_input_file
def day6_1():
input_list = read_input_file("day6.txt", input_type=str)
answers = get_all_yes_answers_per_group(input_list)
amount_yes_answers = 0
for answers_per_group in answers:
amount_yes_answers += len(answers_per_group)
... | 26.634615 | 60 | 0.61083 | from typing import List, Set
from io_utils import read_input_file
def day6_1():
input_list = read_input_file("day6.txt", input_type=str)
answers = get_all_yes_answers_per_group(input_list)
amount_yes_answers = 0
for answers_per_group in answers:
amount_yes_answers += len(answers_per_group)
... | true | true |
f71768dfa296b62f40248813c15aa926044590df | 360 | py | Python | votes/migrations/0002_auto_20190529_0721.py | isidaruk/eurovision_project | 976743e66a2fed17c0513f17a9a7d35850e9cde5 | [
"MIT"
] | null | null | null | votes/migrations/0002_auto_20190529_0721.py | isidaruk/eurovision_project | 976743e66a2fed17c0513f17a9a7d35850e9cde5 | [
"MIT"
] | 8 | 2020-02-12T00:23:27.000Z | 2022-03-08T21:10:13.000Z | votes/migrations/0002_auto_20190529_0721.py | isidaruk/eurovision_project | 976743e66a2fed17c0513f17a9a7d35850e9cde5 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-05-29 07:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('votes', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='vote',
old_name='to_country',
new_... | 18.947368 | 47 | 0.580556 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('votes', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='vote',
old_name='to_country',
new_name='to_participant',
),
]
| true | true |
f717690a322e1a696f5c7c83ea215426620aa34e | 673 | py | Python | src/data/456.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | src/data/456.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | src/data/456.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | from collections import deque
n, m = map(int, input().split())
graph = [list() for _ in range(n)]
for _ in range(n - 1):
u, k = [int(x) for x in input().split()] # uは頂点番号、kは隣接頂点の個数
u, k = u - 1, k - 1
graph[u].append(k)
graph[k].append(u) # 無向グラフ
dist = [-1] * n #距離
dist[0] = 0 #startは0
q = dequ... | 21.03125 | 64 | 0.499257 | from collections import deque
n, m = map(int, input().split())
graph = [list() for _ in range(n)]
for _ in range(n - 1):
u, k = [int(x) for x in input().split()]
u, k = u - 1, k - 1
graph[u].append(k)
graph[k].append(u)
dist = [-1] * n
dist[0] = 0
q = deque()
q.append(0)
while q:
v =... | true | true |
f71769abced2b28f75a37afaba30e87febaaf7f8 | 2,143 | py | Python | Tracker/update.py | nordwind80/BT-Tracker | 558c15b399871c1ca11d0c4ae1eb598e3060931e | [
"MIT"
] | 1 | 2019-05-05T06:46:27.000Z | 2019-05-05T06:46:27.000Z | Tracker/update.py | nordwind80/BT-Tracker | 558c15b399871c1ca11d0c4ae1eb598e3060931e | [
"MIT"
] | null | null | null | Tracker/update.py | nordwind80/BT-Tracker | 558c15b399871c1ca11d0c4ae1eb598e3060931e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Author: eaglewings
# E-Mail: ZWFnbGV3aW5ncy55aUBnbWFpbC5jb20=
# Created Time: 2019-04-17 15:17
# Last Modified:
# Description:
# - Project: BT Trackers Updater
# - File Name: update.py
# - Trackers Updater
import os
import re
from typing import NoReturn
class Filer... | 26.45679 | 95 | 0.527765 |
import os
import re
from typing import NoReturn
class Filer(object):
def __init__(self):
self._aria2_path = "/.aria2/"
self._file_name = "aria2.conf"
self._file_path = f"{self._get_home}{self._aria2_path}"
@property
def _get_home(self) -> str:
return os.path.ex... | true | true |
f7176bc8b9827c81ae4f1e4df6897e9563ad218f | 2,628 | py | Python | source/boundaryconds.py | agstub/sglake-detectability | 5556250a59d7f500bcee86899dd9a497a368faca | [
"MIT"
] | 1 | 2021-05-27T12:24:35.000Z | 2021-05-27T12:24:35.000Z | source/boundaryconds.py | ldeo-glaciology/sglake-detectability | 5556250a59d7f500bcee86899dd9a497a368faca | [
"MIT"
] | null | null | null | source/boundaryconds.py | ldeo-glaciology/sglake-detectability | 5556250a59d7f500bcee86899dd9a497a368faca | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------------
# This file contains functions that:
# (1) define the boundaries (ice-air,ice-water,ice-bed) of the mesh, AND...
# (2) mark the boundaries of the mesh
#-------------------------------------------------------------------------------
from pa... | 35.04 | 85 | 0.614916 |
from params import tol,Lngth,Hght
from geometry import bed
import numpy as np
from dolfin import *
class WaterBoundary(SubDomain):
def inside(self, x, on_boundary):
return (on_boundary and (x[1]<0.5*Hght))
class BedBoundary(SubDomain):
def inside(self, x, on_bou... | true | true |
f7176c29d3c8975aef635b4e3270b662412a46af | 1,825 | py | Python | data_mining/dataset/main.py | basantbhandari/LaptopPricePrediction | 086cfaf99b7c625345d5d383ba7f7e2109821c43 | [
"MIT"
] | null | null | null | data_mining/dataset/main.py | basantbhandari/LaptopPricePrediction | 086cfaf99b7c625345d5d383ba7f7e2109821c43 | [
"MIT"
] | null | null | null | data_mining/dataset/main.py | basantbhandari/LaptopPricePrediction | 086cfaf99b7c625345d5d383ba7f7e2109821c43 | [
"MIT"
] | null | null | null | print("Scrape the dataset from...")
# import the necessary library
from bs4 import BeautifulSoup
import requests
import pandas as pd
# Request to website and download HTML contents
url='https://www.gadgetbytenepal.com/category/laptop-price-in-nepal/'
# write data in a file.
file1 = open("alldata.txt","w")
req=req... | 19.623656 | 84 | 0.447671 | print("Scrape the dataset from...")
from bs4 import BeautifulSoup
import requests
import pandas as pd
url='https://www.gadgetbytenepal.com/category/laptop-price-in-nepal/'
file1 = open("alldata.txt","w")
req=requests.get(url)
htmlcontent=req.content
soup=BeautifulSoup(htmlcontent, 'html.parser')
desired_c... | true | true |
f7176c890702cb23e4dd9472f56d2732e8d22b76 | 7,927 | py | Python | tests_python/tests_008/test_basic.py | arvidj/tezos | 9d9e75425ebd603e9e6b9158d573424cd74e9a30 | [
"MIT"
] | null | null | null | tests_python/tests_008/test_basic.py | arvidj/tezos | 9d9e75425ebd603e9e6b9158d573424cd74e9a30 | [
"MIT"
] | null | null | null | tests_python/tests_008/test_basic.py | arvidj/tezos | 9d9e75425ebd603e9e6b9158d573424cd74e9a30 | [
"MIT"
] | null | null | null | from os import path
import pytest
from client.client import Client
from tools import utils
from tools.paths import ACCOUNT_PATH
from tools.utils import assert_run_failure
from .contract_paths import CONTRACT_PATH
TRANSFER_ARGS = ['--burn-cap', '0.257']
@pytest.mark.incremental
class TestRawContext:
def test_del... | 35.707207 | 80 | 0.608931 | from os import path
import pytest
from client.client import Client
from tools import utils
from tools.paths import ACCOUNT_PATH
from tools.utils import assert_run_failure
from .contract_paths import CONTRACT_PATH
TRANSFER_ARGS = ['--burn-cap', '0.257']
@pytest.mark.incremental
class TestRawContext:
def test_del... | true | true |
f7176e98b7a02c6157bf7280dc45d7ede12e9f2b | 2,915 | py | Python | Bio/Geo/Record.py | bneron/biopython | 2c52e57661c8f6cdf4a191850b2f6871f8582af7 | [
"PostgreSQL"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Bio/Geo/Record.py | bneron/biopython | 2c52e57661c8f6cdf4a191850b2f6871f8582af7 | [
"PostgreSQL"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Bio/Geo/Record.py | bneron/biopython | 2c52e57661c8f6cdf4a191850b2f6871f8582af7 | [
"PostgreSQL"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | # Copyright 2001 by Katharine Lindner. All rights reserved.
# Copyright 2006 by PeterC. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Hold GEO data in a straightforward fo... | 32.032967 | 71 | 0.540995 |
from __future__ import print_function
class Record(object):
def __init__(self):
self.entity_type = ''
self.entity_id = ''
self.entity_attributes = {}
self.col_defs = {}
self.table_rows = []
def __str__(self):
output = ''
output += 'GEO Type: %s\n... | true | true |
f7176eb2dd972a167ede03275af13333e556edee | 829 | py | Python | setup.py | brandjon/iast | 23961536c3bfb5d8fce39c28214ea88b8072450c | [
"PSF-2.0"
] | 11 | 2015-01-04T08:40:09.000Z | 2021-03-24T03:56:34.000Z | setup.py | brandjon/iast | 23961536c3bfb5d8fce39c28214ea88b8072450c | [
"PSF-2.0"
] | null | null | null | setup.py | brandjon/iast | 23961536c3bfb5d8fce39c28214ea88b8072450c | [
"PSF-2.0"
] | null | null | null | from setuptools import setup
setup(
name = 'iAST',
version = '0.2.1',
url = 'https://github.com/brandjon/iast',
author = 'Jon Brandvein',
author_email = 'jon.brandvein@gmail.com',
license = 'MIT License',
description = 'A library for defining an... | 29.607143 | 71 | 0.546441 | from setuptools import setup
setup(
name = 'iAST',
version = '0.2.1',
url = 'https://github.com/brandjon/iast',
author = 'Jon Brandvein',
author_email = 'jon.brandvein@gmail.com',
license = 'MIT License',
description = 'A library for defining an... | true | true |
f717706b17d80b336156b8f3eb5d703f5a5b7596 | 3,082 | py | Python | airbyte-integrations/connectors/source-paypal-transaction/bin/fixture_helper.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 2 | 2021-08-04T03:17:38.000Z | 2021-11-15T10:16:08.000Z | airbyte-integrations/connectors/source-paypal-transaction/bin/fixture_helper.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 52 | 2021-06-11T12:39:05.000Z | 2022-03-30T04:59:35.000Z | airbyte-integrations/connectors/source-paypal-transaction/bin/fixture_helper.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 2 | 2021-12-14T17:15:40.000Z | 2021-12-14T17:18:03.000Z | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | 28.018182 | 130 | 0.658014 |
import logging
from pprint import pprint
import requests
logging.basicConfig(level=logging.DEBUG)
specification = {
"client_id": "REPLACE_ME",
"secret": "REPLACE_ME",
"start_date": "2021-06-01T00:00:00+00:00",
"end_date": "2021-06-30T00:00:00+00:00",
"is_sandbox": True,
... | true | true |
f71770a671bd24aaba89e7db742a94eb08713f1f | 2,095 | py | Python | test/main_test.py | vaughn-johnson/talkspace-public-api | 20eca278e8ac651f610d6afaff8fdc3fce2918fc | [
"MIT"
] | null | null | null | test/main_test.py | vaughn-johnson/talkspace-public-api | 20eca278e8ac651f610d6afaff8fdc3fce2918fc | [
"MIT"
] | 6 | 2020-11-19T04:25:05.000Z | 2020-11-20T20:53:32.000Z | test/main_test.py | vaughn-johnson/talkspace-public-api | 20eca278e8ac651f610d6afaff8fdc3fce2918fc | [
"MIT"
] | null | null | null | from unittest.mock import MagicMock, Mock, patch
from .mock_mongo import MockPyMongo
import json
import sys
import os
### TEST SETUP ###
EXPECTED_DATA_FRAME_FILENAME = os.path.join(os.path.dirname(__file__),
'expected_response.json')
EXPECTED_DATA_FRAME = open(EXPECTED_DATA_FR... | 26.858974 | 70 | 0.686396 | from unittest.mock import MagicMock, Mock, patch
from .mock_mongo import MockPyMongo
import json
import sys
import os
.join(os.path.dirname(__file__),
'expected_response.json')
EXPECTED_DATA_FRAME = open(EXPECTED_DATA_FRAME_FILENAME).read()
sys.modules['pymongo'] = MockPyMongo... | true | true |
f7177131572435ea6057a138ae45fca472fca8a1 | 50,438 | py | Python | train/comms/pt/comms.py | caogao/param | 9de2602c894df264a004c352ee16abc14f93da76 | [
"MIT"
] | null | null | null | train/comms/pt/comms.py | caogao/param | 9de2602c894df264a004c352ee16abc14f93da76 | [
"MIT"
] | null | null | null | train/comms/pt/comms.py | caogao/param | 9de2602c894df264a004c352ee16abc14f93da76 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import logging
imp... | 41.207516 | 180 | 0.567865 |
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import logging
import time
import comms_utils
import numpy as np
import torch
from comms_utils import paramCommsBench, ensureTensorFlush
"all_to_allv",
"all_gather",
"broadcast",
"reduce_scatt... | true | true |
f717719b096d0afc9e9656a8a3d67b6ed3d90cd0 | 3,338 | py | Python | mime/agent/script_agent_augmented.py | rjgpinel/mime-release | 26a850c4ba5b702b86d068995614163338fb01df | [
"MIT"
] | null | null | null | mime/agent/script_agent_augmented.py | rjgpinel/mime-release | 26a850c4ba5b702b86d068995614163338fb01df | [
"MIT"
] | null | null | null | mime/agent/script_agent_augmented.py | rjgpinel/mime-release | 26a850c4ba5b702b86d068995614163338fb01df | [
"MIT"
] | null | null | null | import itertools
import types
import numpy as np
import torch
import click
import gym
import time
import yaml
from robos2r.model import build_model
from .agent import Agent
from .script_agent import ScriptAgent, make_noised
from .utils import Rate
from PIL import Image
from pathlib import Path
from einops import rear... | 31.490566 | 107 | 0.641402 | import itertools
import types
import numpy as np
import torch
import click
import gym
import time
import yaml
from robos2r.model import build_model
from .agent import Agent
from .script_agent import ScriptAgent, make_noised
from .utils import Rate
from PIL import Image
from pathlib import Path
from einops import rear... | true | true |
f71771ce6064be5fc44ff24790cce8db6106923c | 8,762 | py | Python | benchmark_runner/common/clouds/shared/s3/s3_operations.py | kpouget/benchmark-runner | eecdb57d12f8c17268800632722af8fe8046185a | [
"Apache-2.0"
] | 10 | 2021-07-21T21:44:20.000Z | 2022-02-24T22:01:13.000Z | benchmark_runner/common/clouds/shared/s3/s3_operations.py | kpouget/benchmark-runner | eecdb57d12f8c17268800632722af8fe8046185a | [
"Apache-2.0"
] | 83 | 2021-07-20T14:37:44.000Z | 2022-03-24T13:48:04.000Z | benchmark_runner/common/clouds/shared/s3/s3_operations.py | kpouget/benchmark-runner | eecdb57d12f8c17268800632722af8fe8046185a | [
"Apache-2.0"
] | 6 | 2021-07-14T21:12:48.000Z | 2022-02-15T12:48:27.000Z |
import os
import boto3
import typeguard
from botocore.exceptions import ClientError
from os import listdir
from os.path import isfile, join
from benchmark_runner.common.clouds.shared.s3.s3_operations_exceptions import S3FileNotUploaded, S3FileNotDownloaded, S3FileNotDeleted, S3KeyNotCreated, S3FileNotExist, S3Failed... | 37.127119 | 195 | 0.57738 |
import os
import boto3
import typeguard
from botocore.exceptions import ClientError
from os import listdir
from os.path import isfile, join
from benchmark_runner.common.clouds.shared.s3.s3_operations_exceptions import S3FileNotUploaded, S3FileNotDownloaded, S3FileNotDeleted, S3KeyNotCreated, S3FileNotExist, S3Failed... | true | true |
f71772584a21b6b069b86c34169c1b8debf5cb25 | 476 | py | Python | erinn/python/models/__init__.py | swcjack6931677/ERINN | a4f3d0ad213515bc86e2a18575537d6affd472ac | [
"MIT"
] | null | null | null | erinn/python/models/__init__.py | swcjack6931677/ERINN | a4f3d0ad213515bc86e2a18575537d6affd472ac | [
"MIT"
] | null | null | null | erinn/python/models/__init__.py | swcjack6931677/ERINN | a4f3d0ad213515bc86e2a18575537d6affd472ac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import CNN
from . import CNN1D
from . import CNN1D_Rx
from . import CNN1D_Tx
from . import DFN
# Globally-importable models.
from .CNN import get_cnn_relu
from .CNN1D import get_... | 25.052632 | 39 | 0.813025 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import CNN
from . import CNN1D
from . import CNN1D_Rx
from . import CNN1D_Tx
from . import DFN
from .CNN import get_cnn_relu
from .CNN1D import get_cnn1d_relu
from .CNN1D_Rx import get_cnn1d_rx_relu
f... | true | true |
f717729d6712f5bbd8b1c9f44dde5e6c1bc8107e | 411 | py | Python | server/config.py | ahnaf-zamil/flask-react-session-authenticaton-tutorial | 88c454af9932435d0bd9ad1c16718beb6fc0e1c1 | [
"MIT"
] | 1 | 2021-11-01T10:46:16.000Z | 2021-11-01T10:46:16.000Z | server/config.py | ahnaf-zamil/flask-react-session-authenticaton-tutorial | 88c454af9932435d0bd9ad1c16718beb6fc0e1c1 | [
"MIT"
] | null | null | null | server/config.py | ahnaf-zamil/flask-react-session-authenticaton-tutorial | 88c454af9932435d0bd9ad1c16718beb6fc0e1c1 | [
"MIT"
] | null | null | null | from dotenv import load_dotenv
import os
import redis
load_dotenv()
class ApplicationConfig:
SECRET_KEY = os.environ["SECRET_KEY"]
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = r"sqlite:///./db.sqlite"
SESSION_TYPE = "redis"
SESSION_PERMANENT = False... | 24.176471 | 60 | 0.734793 | from dotenv import load_dotenv
import os
import redis
load_dotenv()
class ApplicationConfig:
SECRET_KEY = os.environ["SECRET_KEY"]
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = True
SQLALCHEMY_DATABASE_URI = r"sqlite:///./db.sqlite"
SESSION_TYPE = "redis"
SESSION_PERMANENT = False... | true | true |
f71772cc3a746eb0432c3f9d0877b4f980c06a5f | 1,344 | py | Python | Embed.py | zhengxiawu/Transformer | 8cad013913254ea4e06c4a8d460d9f2cf42df086 | [
"Apache-2.0"
] | null | null | null | Embed.py | zhengxiawu/Transformer | 8cad013913254ea4e06c4a8d460d9f2cf42df086 | [
"Apache-2.0"
] | null | null | null | Embed.py | zhengxiawu/Transformer | 8cad013913254ea4e06c4a8d460d9f2cf42df086 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import math
from torch.autograd import Variable
class Embedder(nn.Module):
def __init__(self, vocab_size, d_model):
super().__init__()
self.d_model = d_model
self.embed = nn.Embedding(vocab_size, d_model)
def forward(self, x):
return self.emb... | 30.545455 | 70 | 0.563244 | import torch
import torch.nn as nn
import math
from torch.autograd import Variable
class Embedder(nn.Module):
def __init__(self, vocab_size, d_model):
super().__init__()
self.d_model = d_model
self.embed = nn.Embedding(vocab_size, d_model)
def forward(self, x):
return self.emb... | true | true |
f71772d3409ea5f7a2383df7d2159cca0dc08add | 8,729 | py | Python | rl/train_a2c_mc.py | ds4dm/GraphRL | b5b1519f6dd92b401625d51add9ae5829004a30b | [
"MIT"
] | 2 | 2021-02-26T18:51:01.000Z | 2021-07-12T05:20:18.000Z | rl/train_a2c_mc.py | pandat8/GraphRL | b5b1519f6dd92b401625d51add9ae5829004a30b | [
"MIT"
] | 3 | 2019-05-09T20:59:10.000Z | 2020-05-13T14:03:50.000Z | rl/train_a2c_mc.py | pandat8/GraphRL | b5b1519f6dd92b401625d51add9ae5829004a30b | [
"MIT"
] | 3 | 2018-08-13T20:43:29.000Z | 2020-05-13T14:00:57.000Z | import torch
import torch.optim as optm
import torch.nn.functional as F
import numpy as np
from torch.autograd import Variable
from torch.utils.data import Dataset, DataLoader
from data.graph import Graph
from collections import namedtuple
SavedAction = namedtuple('SavedAction', ['log_prob', 'value_current'])
# Mont... | 47.961538 | 172 | 0.520907 | import torch
import torch.optim as optm
import torch.nn.functional as F
import numpy as np
from torch.autograd import Variable
from torch.utils.data import Dataset, DataLoader
from data.graph import Graph
from collections import namedtuple
SavedAction = namedtuple('SavedAction', ['log_prob', 'value_current'])
class... | true | true |
f71774d3bb18a2b3e70569ab8a10dcf140e26e81 | 5,989 | py | Python | submit_data.py | dimagi/submission_api_example | 266eb36c6ef6b331ea894298cbacfd2752410f80 | [
"Apache-2.0"
] | null | null | null | submit_data.py | dimagi/submission_api_example | 266eb36c6ef6b331ea894298cbacfd2752410f80 | [
"Apache-2.0"
] | 1 | 2021-12-06T20:29:54.000Z | 2021-12-13T20:32:37.000Z | submit_data.py | dimagi/submission_api_example | 266eb36c6ef6b331ea894298cbacfd2752410f80 | [
"Apache-2.0"
] | 1 | 2021-12-06T20:27:00.000Z | 2021-12-06T20:27:00.000Z | #!/usr/bin/env python3
"""
An example script to send data to CommCare using the Submission API
Usage:
$ export CCHQ_PROJECT_SPACE=my-project-space
$ export CCHQ_CASE_TYPE=person
$ export CCHQ_USERNAME=user@example.com
$ export CCHQ_PASSWORD=MijByG_se3EcKr.t
$ export CCHQ_USER_ID=c0ffeeeeeb574eb8b5... | 29.357843 | 79 | 0.646185 |
FORM_XMLNS = 'http://example.com/submission-api-example-form/'
DEVICE_ID = "submission_api_example"
import csv
import os
import sys
import uuid
from dataclasses import dataclass
from datetime import datetime, timezone
from http.client import responses as http_responses
from typing import Any, Iterable, List, ... | true | true |
f717755be13370d96e8eff2b66e83a3b18716be8 | 515 | py | Python | setup.py | Krozark/meteofrance-py | 7328a857022f263d1609c939851f612c5ed13d08 | [
"MIT"
] | null | null | null | setup.py | Krozark/meteofrance-py | 7328a857022f263d1609c939851f612c5ed13d08 | [
"MIT"
] | null | null | null | setup.py | Krozark/meteofrance-py | 7328a857022f263d1609c939851f612c5ed13d08 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='krozark-meteofrance',
version='0.3.9',
description = 'Meteo-France weather forecast',
author = 'victorcerutti',
author_email = 'maxime.barbier1991+meteofrance@gmail.com',
url = 'https://github.com/Krozark/meteofrance-py',
packages=['meteofrance',],
... | 27.105263 | 85 | 0.664078 | from setuptools import setup
setup(
name='krozark-meteofrance',
version='0.3.9',
description = 'Meteo-France weather forecast',
author = 'victorcerutti',
author_email = 'maxime.barbier1991+meteofrance@gmail.com',
url = 'https://github.com/Krozark/meteofrance-py',
packages=['meteofrance',],
... | true | true |
f7177676b64b016a2006776e619b093446b0ff41 | 5,353 | py | Python | test/language/choice_types/python/UInt64ParamChoiceTest.py | PeachOS/zserio | ea01f6906c125a6baab7e8ed865eeb08cd46c37c | [
"BSD-3-Clause"
] | 2 | 2019-02-06T17:50:24.000Z | 2019-11-20T16:51:34.000Z | test/language/choice_types/python/UInt64ParamChoiceTest.py | PeachOS/zserio | ea01f6906c125a6baab7e8ed865eeb08cd46c37c | [
"BSD-3-Clause"
] | 1 | 2019-11-25T16:25:51.000Z | 2019-11-25T18:09:39.000Z | test/language/choice_types/python/UInt64ParamChoiceTest.py | PeachOS/zserio | ea01f6906c125a6baab7e8ed865eeb08cd46c37c | [
"BSD-3-Clause"
] | null | null | null | import unittest
import zserio
from testutils import getZserioApi
class UInt64ParamChoiceTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "choice_types.zs").uint64_param_choice
def testSelectorConstructor(self):
uint64ParamChoice = self.api.UInt64... | 40.862595 | 86 | 0.721838 | import unittest
import zserio
from testutils import getZserioApi
class UInt64ParamChoiceTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "choice_types.zs").uint64_param_choice
def testSelectorConstructor(self):
uint64ParamChoice = self.api.UInt64... | true | true |
f717772bd33c93521c158ce38b78042fe52c2ff5 | 52 | py | Python | subjects/__init__.py | ankit0tech/Research-Productivity-Tool | c08e39daaaa8dfa08f5eb2607986d9f6bf9f02fa | [
"MIT"
] | 1 | 2021-12-12T04:54:05.000Z | 2021-12-12T04:54:05.000Z | subjects/__init__.py | ankit0tech/Research-Productivity-Tool | c08e39daaaa8dfa08f5eb2607986d9f6bf9f02fa | [
"MIT"
] | null | null | null | subjects/__init__.py | ankit0tech/Research-Productivity-Tool | c08e39daaaa8dfa08f5eb2607986d9f6bf9f02fa | [
"MIT"
] | null | null | null | default_app_config = 'subjects.apps.SubjectsConfig'
| 26 | 51 | 0.846154 | default_app_config = 'subjects.apps.SubjectsConfig'
| true | true |
f71777438e6b24d7bdde702a1788bd674bd9b0a3 | 589 | py | Python | Appium_learning/02_ChangeApp.py | yeyuning1/AutoTT | 1ce88e9e73d71fa11d4d8ad12bd6741aa71f97d2 | [
"MIT"
] | null | null | null | Appium_learning/02_ChangeApp.py | yeyuning1/AutoTT | 1ce88e9e73d71fa11d4d8ad12bd6741aa71f97d2 | [
"MIT"
] | 1 | 2021-06-02T00:24:41.000Z | 2021-06-02T00:24:41.000Z | Appium_learning/02_ChangeApp.py | yeyuning1/AutoTT | 1ce88e9e73d71fa11d4d8ad12bd6741aa71f97d2 | [
"MIT"
] | null | null | null | import time
from appium import webdriver
from Appium_learning import app_settings
driver = webdriver.Remote('http://localhost:4723/wd/hub', app_settings.desired_caps)
print(driver.current_package)
print(driver.current_activity)
print(driver.context)
time.sleep(5)
# adb shell dumpsys window windows | findstr(grep) mFo... | 31 | 95 | 0.814941 | import time
from appium import webdriver
from Appium_learning import app_settings
driver = webdriver.Remote('http://localhost:4723/wd/hub', app_settings.desired_caps)
print(driver.current_package)
print(driver.current_activity)
print(driver.context)
time.sleep(5)
driver.start_activity('com.android.messaging', '.ui.c... | true | true |
f717798fa86a8765f50f6a661d1e837315188e97 | 2,151 | py | Python | setup.py | deliri/ChatterBot | 8d95c43371bf8b7b1a1c44f77827b239bf38dc4e | [
"BSD-3-Clause"
] | 1 | 2021-03-06T00:28:20.000Z | 2021-03-06T00:28:20.000Z | setup.py | deliri/ChatterBot | 8d95c43371bf8b7b1a1c44f77827b239bf38dc4e | [
"BSD-3-Clause"
] | null | null | null | setup.py | deliri/ChatterBot | 8d95c43371bf8b7b1a1c44f77827b239bf38dc4e | [
"BSD-3-Clause"
] | 2 | 2017-05-30T02:18:30.000Z | 2021-02-21T18:15:25.000Z | #!/usr/bin/env python
"""
ChatterBot setup file.
"""
from setuptools import setup
# Dynamically retrieve the version information from the chatterbot module
CHATTERBOT = __import__('chatterbot')
VERSION = CHATTERBOT.__version__
AUTHOR = CHATTERBOT.__author__
AUTHOR_EMAIL = CHATTERBOT.__email__
URL = CHATTERBOT.__url__... | 31.173913 | 73 | 0.653185 |
from setuptools import setup
CHATTERBOT = __import__('chatterbot')
VERSION = CHATTERBOT.__version__
AUTHOR = CHATTERBOT.__author__
AUTHOR_EMAIL = CHATTERBOT.__email__
URL = CHATTERBOT.__url__
DESCRIPTION = CHATTERBOT.__doc__
with open('requirements.txt') as requirements:
REQUIREMENTS = requirements.readlines()... | true | true |
f71779abb101df0998a79dffc26322edc971e6e8 | 10,423 | py | Python | seleniumbase/core/jqc_helper.py | mdmintz/seleniumspot | f5c225aa4fcd0b4124fc990e3892c36736290ce8 | [
"MIT"
] | 1 | 2015-06-17T10:16:26.000Z | 2015-06-17T10:16:26.000Z | seleniumbase/core/jqc_helper.py | mdmintz/seleniumspot | f5c225aa4fcd0b4124fc990e3892c36736290ce8 | [
"MIT"
] | null | null | null | seleniumbase/core/jqc_helper.py | mdmintz/seleniumspot | f5c225aa4fcd0b4124fc990e3892c36736290ce8 | [
"MIT"
] | null | null | null | """
This module contains methods for opening jquery-confirm boxes.
These helper methods SHOULD NOT be called directly from tests.
"""
from seleniumbase.fixtures import constants
from seleniumbase.fixtures import js_utils
form_code = """'<form align="center" action="" class="jqc_form">' +
'<div class="form-group">... | 33.300319 | 75 | 0.515399 | from seleniumbase.fixtures import constants
from seleniumbase.fixtures import js_utils
form_code = """'<form align="center" action="" class="jqc_form">' +
'<div class="form-group">' +
'<input style="font-size:20px; background-color: #f8fdfd; ' +
' width: 84%%; border: 1px solid blue; ' +
' box-shadow:... | true | true |
f71779ec19d93ec24d41da7b598913f8c5798de5 | 1,316 | py | Python | ShowProcess.py | 4a5g0030/line_follow | 570e65fb62803f7f5062402a45654809b01b7aaa | [
"MIT"
] | 1 | 2019-06-19T18:32:28.000Z | 2019-06-19T18:32:28.000Z | ShowProcess.py | 4a5g0030/line_follow | 570e65fb62803f7f5062402a45654809b01b7aaa | [
"MIT"
] | null | null | null | ShowProcess.py | 4a5g0030/line_follow | 570e65fb62803f7f5062402a45654809b01b7aaa | [
"MIT"
] | null | null | null | import time
import sys
class ShowProcess():
# """
# 显示处理进度的类
# 调用该类相关函数即可实现处理进度的显示
# """
i = 0 # 当前的处理进度
max_steps = 0 # 总共需要处理的次数
max_arrow = 50 #进度条的长度
infoDone = 'done'
# 初始化函数,需要知道总共的处理次数
def __init__(self, max_steps, infoDone = 'Done'):
self.max_steps = max_steps
... | 29.909091 | 77 | 0.534195 | import time
import sys
class ShowProcess():
# 显示处理进度的类
# 调用该类相关函数即可实现处理进度的显示
# """
i = 0
max_steps = 0
max_arrow = 50
infoDone = 'done'
def __init__(self, max_steps, infoDone = 'Done'):
self.max_steps = max_steps
self.i = 0
self.infoDone = infoDone
... | true | true |
f7177a2b9fd9f213e95853d3176e200b98b80f37 | 1,793 | py | Python | unitest/test_supermesh.py | JeremieMelo/ADEPT | f79f518197798735cb684b373e11cdcc8a80d872 | [
"MIT"
] | 5 | 2022-02-26T09:14:47.000Z | 2022-03-20T22:57:06.000Z | unitest/test_supermesh.py | JeremieMelo/ADEPT | f79f518197798735cb684b373e11cdcc8a80d872 | [
"MIT"
] | null | null | null | unitest/test_supermesh.py | JeremieMelo/ADEPT | f79f518197798735cb684b373e11cdcc8a80d872 | [
"MIT"
] | null | null | null | '''
Description:
Author: Jiaqi Gu (jqgu@utexas.edu)
Date: 2021-09-27 23:48:01
LastEditors: Jiaqi Gu (jqgu@utexas.edu)
LastEditTime: 2022-02-26 02:22:52
'''
import torch
from core.models.layers.super_mesh import super_layer_name_dict
def test():
device=torch.device("cuda:0")
p, q, k = 2, 2, 4
x = torch.eye(... | 28.460317 | 110 | 0.644172 | import torch
from core.models.layers.super_mesh import super_layer_name_dict
def test():
device=torch.device("cuda:0")
p, q, k = 2, 2, 4
x = torch.eye(k, dtype=torch.cfloat, device=device).unsqueeze(0).repeat(q,1,1).permute(1,0,2).contiguous()
sigma = torch.ones(p,q,k, device=device)
arch = d... | true | true |
f7177a7169c09bf58f9be260fccfe1d0276b2e83 | 712 | py | Python | parsons/google/utitities.py | Tomiiwa/parsons | 3886327c197e357ba5342603d8409774a541333b | [
"Apache-2.0"
] | 3 | 2019-09-05T16:57:15.000Z | 2019-10-01T19:56:58.000Z | parsons/google/utitities.py | Tomiiwa/parsons | 3886327c197e357ba5342603d8409774a541333b | [
"Apache-2.0"
] | 22 | 2019-09-03T13:23:37.000Z | 2019-10-03T20:32:48.000Z | parsons/google/utitities.py | Tomiiwa/parsons | 3886327c197e357ba5342603d8409774a541333b | [
"Apache-2.0"
] | 2 | 2019-09-01T18:30:10.000Z | 2019-10-03T20:07:46.000Z | from parsons.utilities import files
from parsons.utilities import check_env
import json
import os
def setup_google_application_credentials(app_creds, env_var_name='GOOGLE_APPLICATION_CREDENTIALS'):
# Detect if app_creds is a dict, path string or json string, and if it is a
# json string, then convert it to a ... | 35.6 | 99 | 0.738764 | from parsons.utilities import files
from parsons.utilities import check_env
import json
import os
def setup_google_application_credentials(app_creds, env_var_name='GOOGLE_APPLICATION_CREDENTIALS'):
credentials = check_env.check(env_var_name, app_creds)
try:
if (type(credentials) is dict... | true | true |
f7177a79f201b728ccb90ed68b5736930baa2a1a | 4,126 | py | Python | xsimlab/ipython.py | jvail/xarray-simlab | 3e8cb81775868e3e7c6495489ba351567e0d7e42 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 48 | 2017-06-19T16:31:37.000Z | 2021-04-26T04:42:48.000Z | xsimlab/ipython.py | jvail/xarray-simlab | 3e8cb81775868e3e7c6495489ba351567e0d7e42 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 108 | 2017-06-26T12:22:10.000Z | 2021-03-09T08:57:02.000Z | xsimlab/ipython.py | jvail/xarray-simlab | 3e8cb81775868e3e7c6495489ba351567e0d7e42 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 10 | 2017-08-11T04:56:20.000Z | 2021-03-01T16:46:55.000Z | import textwrap
from IPython.core.magic import Magics, magics_class, line_magic
from IPython.core import magic_arguments
import attr
from .formatting import format_var_dims
from .model import Model
from .utils import variables_dict
setup_template = """
import xsimlab as xs
ds_in = xs.create_setup(
model={model... | 27.506667 | 86 | 0.574649 | import textwrap
from IPython.core.magic import Magics, magics_class, line_magic
from IPython.core import magic_arguments
import attr
from .formatting import format_var_dims
from .model import Model
from .utils import variables_dict
setup_template = """
import xsimlab as xs
ds_in = xs.create_setup(
model={model... | true | true |
f7177b1e4046a2c4d8c4f139594073d0ad624f46 | 752 | py | Python | api/tournaments/migrations/0002_auto_20190804_1830.py | individuo7/wololo-tournaments-api | 5be6284064373e99346d39c78844e454c41c501d | [
"MIT"
] | 2 | 2019-12-09T10:19:36.000Z | 2020-01-11T11:48:41.000Z | api/tournaments/migrations/0002_auto_20190804_1830.py | individuo7/wololo-tournaments-api | 5be6284064373e99346d39c78844e454c41c501d | [
"MIT"
] | null | null | null | api/tournaments/migrations/0002_auto_20190804_1830.py | individuo7/wololo-tournaments-api | 5be6284064373e99346d39c78844e454c41c501d | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2019-08-04 18:30
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tournaments', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='game',
... | 28.923077 | 132 | 0.630319 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tournaments', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='game',
name='tournament',
field=mod... | true | true |
f7177be77bf1953daf64f669f1516a9413569e6f | 1,785 | py | Python | model/contact.py | dorotan/pythontraining | 13cd9d5d8b0c772951e9caf98166118e7ffa387c | [
"Apache-2.0"
] | null | null | null | model/contact.py | dorotan/pythontraining | 13cd9d5d8b0c772951e9caf98166118e7ffa387c | [
"Apache-2.0"
] | null | null | null | model/contact.py | dorotan/pythontraining | 13cd9d5d8b0c772951e9caf98166118e7ffa387c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'dorota'
from sys import maxsize
class Contact:
def __init__(self, first_name=None, middle_name=None, last_name=None, nickname=None, title=None, company=None,
address=None, home_number=None, mobile_number=None, work_number=None, fax=None, first_email=None,
... | 38.804348 | 119 | 0.656022 |
__author__ = 'dorota'
from sys import maxsize
class Contact:
def __init__(self, first_name=None, middle_name=None, last_name=None, nickname=None, title=None, company=None,
address=None, home_number=None, mobile_number=None, work_number=None, fax=None, first_email=None,
second_e... | true | true |
f7177c158a0506efce3af2ecad52f923c731c8ea | 1,903 | py | Python | inference_exploration/cpu/main.py | nbortolotti/tflite-tpu-experiences | 8f613e059335d1d90886282f005261917fd9cfd3 | [
"Apache-2.0"
] | 1 | 2019-12-06T12:58:33.000Z | 2019-12-06T12:58:33.000Z | inference_exploration/cpu/main.py | nbortolotti/tflite-tpu-experiences | 8f613e059335d1d90886282f005261917fd9cfd3 | [
"Apache-2.0"
] | 9 | 2020-10-12T13:57:32.000Z | 2021-09-16T19:38:26.000Z | inference_exploration/cpu/main.py | nbortolotti/tflite-tpu-experiences | 8f613e059335d1d90886282f005261917fd9cfd3 | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
import PIL.Image as Image
import matplotlib.pylab as plt
import time
import tensorflow as tf
import tensorflow_hub as hub
from tensorflow.keras import layers
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
def image_analysis(classifier, image_shape, img_array):
result = classifier.predict(... | 30.206349 | 123 | 0.695218 | import os
import numpy as np
import PIL.Image as Image
import matplotlib.pylab as plt
import time
import tensorflow as tf
import tensorflow_hub as hub
from tensorflow.keras import layers
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
def image_analysis(classifier, image_shape, img_array):
result = classifier.predict(... | true | true |
f7177d19acc9ab604ff8ca8dd4f7629ce32e4671 | 203 | py | Python | EOC/prototype/data/datasets/__init__.py | double-fire-0/SystemNoise | ab042dd54371482a18117eb13f816a7472e51590 | [
"Apache-2.0"
] | null | null | null | EOC/prototype/data/datasets/__init__.py | double-fire-0/SystemNoise | ab042dd54371482a18117eb13f816a7472e51590 | [
"Apache-2.0"
] | null | null | null | EOC/prototype/data/datasets/__init__.py | double-fire-0/SystemNoise | ab042dd54371482a18117eb13f816a7472e51590 | [
"Apache-2.0"
] | null | null | null | from .imagenet_dataset import ImageNetDataset, RankedImageNetDataset, DecoderResizeImageNetDataset # noqa
from .custom_dataset import CustomDataset # noqa
from .imagnetc import ImageNet_C_Dataset
| 33.833333 | 106 | 0.842365 | from .imagenet_dataset import ImageNetDataset, RankedImageNetDataset, DecoderResizeImageNetDataset
from .custom_dataset import CustomDataset
from .imagnetc import ImageNet_C_Dataset
| true | true |
f7177d37c526cd723adac7c722303a77bd48abdf | 418 | py | Python | blog/migrations/0006_auto_20220427_1014.py | ali-abbaszade/mysite | 9ef1b1211bd827c178f279e69ddbf4c229c539fa | [
"MIT"
] | null | null | null | blog/migrations/0006_auto_20220427_1014.py | ali-abbaszade/mysite | 9ef1b1211bd827c178f279e69ddbf4c229c539fa | [
"MIT"
] | null | null | null | blog/migrations/0006_auto_20220427_1014.py | ali-abbaszade/mysite | 9ef1b1211bd827c178f279e69ddbf4c229c539fa | [
"MIT"
] | null | null | null | # Generated by Django 3.2.12 on 2022-04-27 05:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20220427_1002'),
]
operations = [
migrations.RemoveField(
model_name='post',
name='category... | 19.904762 | 49 | 0.538278 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20220427_1002'),
]
operations = [
migrations.RemoveField(
model_name='post',
name='category',
),
migrations.DeleteModel(
... | true | true |
f7177e32b5e25c3c506bb440f649164a5758e294 | 46,139 | py | Python | manila/share/drivers/generic.py | vponomaryov/manila | ffe135a5b35a0964179f0dc148d569037f26a929 | [
"Apache-2.0"
] | null | null | null | manila/share/drivers/generic.py | vponomaryov/manila | ffe135a5b35a0964179f0dc148d569037f26a929 | [
"Apache-2.0"
] | null | null | null | manila/share/drivers/generic.py | vponomaryov/manila | ffe135a5b35a0964179f0dc148d569037f26a929 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 NetApp, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 44.067813 | 79 | 0.585882 |
import os
import time
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_log import log
from oslo_utils import importutils
from oslo_utils import units
import retrying
import six
from manila.common import constants as const
from manila import compute
from manila import con... | true | true |
f7177eeda341fbfbb4601d6a8a82e1d73d1f95ba | 17,754 | py | Python | acg/custom_widgets/selection_widgets.py | david-fischer/Anki_CardGen | 909d088ed4e98b97f65a2c896dc607941b00e4da | [
"MIT"
] | 2 | 2021-01-11T08:59:57.000Z | 2021-02-01T12:15:30.000Z | acg/custom_widgets/selection_widgets.py | david-fischer/Anki_CardGen | 909d088ed4e98b97f65a2c896dc607941b00e4da | [
"MIT"
] | null | null | null | acg/custom_widgets/selection_widgets.py | david-fischer/Anki_CardGen | 909d088ed4e98b97f65a2c896dc607941b00e4da | [
"MIT"
] | null | null | null | """Implements various elements to get user selection."""
from functools import partial
from kivy.animation import Animation
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.properties import (
BooleanProperty,
ListProperty,
NumericProperty,
ObjectProperty,
OptionProperty,
... | 37.694268 | 118 | 0.652529 |
from functools import partial
from kivy.animation import Animation
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.properties import (
BooleanProperty,
ListProperty,
NumericProperty,
ObjectProperty,
OptionProperty,
StringProperty,
)
from kivy.uix.behaviors import Butto... | true | true |
f7177f17985f47452311b910b6f0dc8fb2631393 | 276 | py | Python | packaging/setup/plugins/ovirt-engine-setup/ovirt_imageio/__init__.py | jihwahn1018/ovirt-engine | 5c8a3d9a9637eefb28e4accc3cbd2b7f530d5ec9 | [
"Apache-2.0"
] | 347 | 2015-01-20T14:13:21.000Z | 2022-03-31T17:53:11.000Z | packaging/setup/plugins/ovirt-engine-setup/ovirt_imageio/__init__.py | jihwahn1018/ovirt-engine | 5c8a3d9a9637eefb28e4accc3cbd2b7f530d5ec9 | [
"Apache-2.0"
] | 128 | 2015-05-22T19:14:32.000Z | 2022-03-31T08:11:18.000Z | packaging/setup/plugins/ovirt-engine-setup/ovirt_imageio/__init__.py | jihwahn1018/ovirt-engine | 5c8a3d9a9637eefb28e4accc3cbd2b7f530d5ec9 | [
"Apache-2.0"
] | 202 | 2015-01-04T06:20:49.000Z | 2022-03-08T15:30:08.000Z | #
# ovirt-engine-setup -- ovirt engine setup
#
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
#
"""ovirt-imageio setup plugin."""
from otopi import util
from . import config
@util.export
def createPlugins(context):
config.Plugin(context=context)
| 13.142857 | 42 | 0.721014 |
from otopi import util
from . import config
@util.export
def createPlugins(context):
config.Plugin(context=context)
| true | true |
f71780030f07f5124673cea42eacb5d831327dea | 543 | py | Python | manage.py | arpitmisraw/Effervescence18-Website | 3c510f066986af80aaced566b32c5040310d3107 | [
"MIT"
] | 2 | 2018-06-27T20:46:16.000Z | 2018-08-02T11:02:26.000Z | manage.py | arpitmisraw/Effervescence18-Website | 3c510f066986af80aaced566b32c5040310d3107 | [
"MIT"
] | 3 | 2020-06-05T18:15:37.000Z | 2021-06-10T20:20:29.000Z | manage.py | arpitmisraw/Effervescence18-Website | 3c510f066986af80aaced566b32c5040310d3107 | [
"MIT"
] | 1 | 2019-08-01T12:06:35.000Z | 2019-08-01T12:06:35.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "effe_portal.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. ... | 33.9375 | 75 | 0.688766 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "effe_portal.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's ins... | true | true |
f71780c4b08f54dd66b5a1991c6159621e4cec1f | 18,071 | py | Python | test/cpython/test_audioop.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:28:45.000Z | 2020-02-06T14:28:45.000Z | test/cpython/test_audioop.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | test/cpython/test_audioop.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:29:00.000Z | 2020-02-06T14:29:00.000Z | # expected: fail
import audioop
import sys
import unittest
import struct
from test.test_support import run_unittest
formats = {
1: 'b',
2: 'h',
4: 'i',
}
def pack(width, data):
return struct.pack('=%d%s' % (len(data), formats[width]), *data)
packs = {
1: lambda *data: pack(1, data),
2: lambd... | 45.749367 | 88 | 0.531791 |
import audioop
import sys
import unittest
import struct
from test.test_support import run_unittest
formats = {
1: 'b',
2: 'h',
4: 'i',
}
def pack(width, data):
return struct.pack('=%d%s' % (len(data), formats[width]), *data)
packs = {
1: lambda *data: pack(1, data),
2: lambda *data: pack(2,... | true | true |
f7178158b29d68a175b0ebeab0012d4e31f2f3e6 | 2,610 | py | Python | boofuzz/requests/http_post.py | youngcraft/boofuzz-modbus | bfeb48345b56797b48079e0620e7b06b27085789 | [
"Apache-2.0"
] | 23 | 2018-08-11T12:12:33.000Z | 2022-01-28T10:22:49.000Z | boofuzz/requests/http_post.py | ctf-fuzzer/boofuzz-modbus | bfeb48345b56797b48079e0620e7b06b27085789 | [
"Apache-2.0"
] | 2 | 2018-07-24T15:15:40.000Z | 2020-07-12T13:06:56.000Z | boofuzz/requests/http_post.py | ctf-fuzzer/boofuzz-modbus | bfeb48345b56797b48079e0620e7b06b27085789 | [
"Apache-2.0"
] | 10 | 2018-04-02T13:21:36.000Z | 2022-01-17T09:20:27.000Z | from boofuzz import *
# All POST mimetypes that I could think of/find
# List of all blocks defined here (for easy copy/paste)
"""
sess.connect(s_get("HTTP VERBS POST"))
sess.connect(s_get("HTTP VERBS POST ALL"))
sess.connect(s_get("HTTP VERBS POST REQ"))
"""
# Fuzz POST requests with most MIMETypes known
s_initial... | 23.944954 | 74 | 0.650958 | from boofuzz import *
s_initialize("HTTP VERBS POST ALL")
s_static("POST / HTTP/1.1\r\n")
s_static("Content-Type: ")
s_group("mimetypes", values=[
"audio/basic",
"audio/x-mpeg",
"drawing/x-dwf",
"graphics/x-inventor",
"image/x-portable-bitmap",
"message/external-body",
"message/http"... | true | true |
f71781cb54b95efe9a515ff1e8acbb559ba8adb6 | 70,600 | py | Python | pyspeckit/spectrum/readers/read_class.py | FaceThePirate/pyspeckit | 734b9f81d440ca3a6db9bf68e9409dbddb52d08b | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pyspeckit/spectrum/readers/read_class.py | FaceThePirate/pyspeckit | 734b9f81d440ca3a6db9bf68e9409dbddb52d08b | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pyspeckit/spectrum/readers/read_class.py | FaceThePirate/pyspeckit | 734b9f81d440ca3a6db9bf68e9409dbddb52d08b | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """
------------------------
GILDAS CLASS file reader
------------------------
Read a CLASS file into an :class:`pyspeckit.spectrum.ObsBlock`
"""
from __future__ import print_function
from six.moves import xrange
from six import iteritems
import six
import astropy.io.fits as pyfits
import numpy
import numpy as np
from... | 42.555756 | 220 | 0.526813 | from __future__ import print_function
from six.moves import xrange
from six import iteritems
import six
import astropy.io.fits as pyfits
import numpy
import numpy as np
from numpy import pi
from astropy import log
from astropy import units as u
import pyspeckit
import sys
import re
try:
from astropy.utils.console ... | true | true |
f71781d481d127f72294f8baec04d9d74461c11a | 121 | py | Python | okta/models/usergroup/__init__.py | rkhleics/oktasdk-python | da8183444704c6d16831d1edd619390e9120dd70 | [
"Apache-2.0"
] | 1 | 2020-09-09T12:59:19.000Z | 2020-09-09T12:59:19.000Z | okta/models/usergroup/__init__.py | torchbox/oktasdk-python | da8183444704c6d16831d1edd619390e9120dd70 | [
"Apache-2.0"
] | null | null | null | okta/models/usergroup/__init__.py | torchbox/oktasdk-python | da8183444704c6d16831d1edd619390e9120dd70 | [
"Apache-2.0"
] | 2 | 2017-11-02T22:12:57.000Z | 2019-09-16T08:02:23.000Z | from .UserGroup import UserGroup
from .UserGroupProfile import UserGroupProfile
from .UserGroupRule import UserGroupRule
| 30.25 | 46 | 0.876033 | from .UserGroup import UserGroup
from .UserGroupProfile import UserGroupProfile
from .UserGroupRule import UserGroupRule
| true | true |
f717822d090647eb7a44dad23a51405caa178759 | 1,679 | py | Python | stockbot/ticker/sinotrade/session.py | tanlin2013/stockbot | 08322ed4d847ea9e58b091985cef5c128a694b12 | [
"Apache-2.0"
] | 1 | 2021-07-12T23:55:20.000Z | 2021-07-12T23:55:20.000Z | stockbot/ticker/sinotrade/session.py | ajmal017/stockbot-7 | 08322ed4d847ea9e58b091985cef5c128a694b12 | [
"Apache-2.0"
] | null | null | null | stockbot/ticker/sinotrade/session.py | ajmal017/stockbot-7 | 08322ed4d847ea9e58b091985cef5c128a694b12 | [
"Apache-2.0"
] | 1 | 2021-07-12T23:55:12.000Z | 2021-07-12T23:55:12.000Z | import os
import logging
import pandas as pd
from datetime import date
from shioaji import Shioaji
class Session(Shioaji):
def __init__(self, simulation: bool = False, timeout: int = 10000) -> None:
"""
Args:
simulation:
timeout:
Notes: The ID of test account ran... | 27.983333 | 98 | 0.596784 | import os
import logging
import pandas as pd
from datetime import date
from shioaji import Shioaji
class Session(Shioaji):
def __init__(self, simulation: bool = False, timeout: int = 10000) -> None:
_person_id = f"PAPIUSER05" \
if simulation else os.environ['SINOTRADE_ID']
_passwd = "... | true | true |
f71782577c5c2b9953da5e9ae6c0a019748c14b7 | 3,361 | py | Python | src/application-insights/azext_applicationinsights/vendored_sdks/applicationinsights/models/events_trace_result.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | src/application-insights/azext_applicationinsights/vendored_sdks/applicationinsights/models/events_trace_result.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | src/application-insights/azext_applicationinsights/vendored_sdks/applicationinsights/models/events_trace_result.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 43.649351 | 107 | 0.650997 |
from .events_result_data import EventsResultData
class EventsTraceResult(EventsResultData):
_validation = {
'type': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'count': {'key': 'count', 'type': 'long'},
'timestamp': {'key': 'tim... | true | true |
f71782e87705531559d4a97ca72db46a973a03f6 | 30,692 | py | Python | examples/ner/run_ner_strain.py | Tarpelite/BERT_self_training | f50ff015f0d3669b5d927a6d28d8a08201c101b6 | [
"MIT"
] | null | null | null | examples/ner/run_ner_strain.py | Tarpelite/BERT_self_training | f50ff015f0d3669b5d927a6d28d8a08201c101b6 | [
"MIT"
] | null | null | null | examples/ner/run_ner_strain.py | Tarpelite/BERT_self_training | f50ff015f0d3669b5d927a6d28d8a08201c101b6 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 44.161151 | 150 | 0.655741 |
import argparse
import glob
import logging
import os
import random
import numpy as np
import torch
from seqeval.metrics import f1_score, precision_score, recall_score
from torch.nn import CrossEntropyLoss
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
from tor... | true | true |
f717830652b40b5662e7d5601be70f7d7dfd33fa | 629 | py | Python | code/LTI/Demos/Tex_matplotlib.py | chipmuenk/acoustics | c85ac95a10c09d7fa15d63b2bdb24acab89fec60 | [
"MIT"
] | null | null | null | code/LTI/Demos/Tex_matplotlib.py | chipmuenk/acoustics | c85ac95a10c09d7fa15d63b2bdb24acab89fec60 | [
"MIT"
] | null | null | null | code/LTI/Demos/Tex_matplotlib.py | chipmuenk/acoustics | c85ac95a10c09d7fa15d63b2bdb24acab89fec60 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon May 14 14:15:52 2012
Plot mit TeX-Formatierung der Labels
(LaTeX muss auf dem Rechner installiert sein)
"""
import numpy as np
from matplotlib import rc
import matplotlib.pyplot as plt
rc('text', usetex=True)
plt.figure(1)
ax = plt.axes([0.1, 0.1, 0.8, 0.7])
t = np.arange(0... | 23.296296 | 84 | 0.659777 |
import numpy as np
from matplotlib import rc
import matplotlib.pyplot as plt
rc('text', usetex=True)
plt.figure(1)
ax = plt.axes([0.1, 0.1, 0.8, 0.7])
t = np.arange(0.0, 1.0+0.01, 0.01)
s = np.cos(2*2*np.pi*t)+2
plt.plot(t, s)
plt.xlabel(r'\textbf{Time (s)}')
plt.ylabel(r'\textit{Voltage} (mV)',fontsize=16)
plt.tit... | true | true |
f717831ab43bf5e60f20fa256ffdf13e2b588a99 | 6,871 | py | Python | env/Lib/site-packages/pyttsx/drivers/dummy.py | TrinhAnBinh/covid_vir_assistant_ver_0.0.2 | b4471f4894c1bc203980f06b811f63e8e8f6b3ab | [
"MIT"
] | 160 | 2016-10-04T22:45:36.000Z | 2022-02-10T06:41:56.000Z | env/Lib/site-packages/pyttsx/drivers/dummy.py | TrinhAnBinh/covid_vir_assistant_ver_0.0.2 | b4471f4894c1bc203980f06b811f63e8e8f6b3ab | [
"MIT"
] | 27 | 2016-10-04T02:45:18.000Z | 2022-03-09T15:15:54.000Z | env/Lib/site-packages/pyttsx/drivers/dummy.py | TrinhAnBinh/covid_vir_assistant_ver_0.0.2 | b4471f4894c1bc203980f06b811f63e8e8f6b3ab | [
"MIT"
] | 58 | 2016-10-06T16:53:43.000Z | 2021-10-21T22:17:35.000Z | '''
Dummy driver that produces no output but gives all expected callbacks. Useful
for testing and as a model for real drivers.
Copyright (c) 2009, 2013 Peter Parente
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright n... | 35.601036 | 85 | 0.625382 | from ..voice import Voice
import time
def buildDriver(proxy):
return DummyDriver(proxy)
class DummyDriver(object):
def __init__(self, proxy):
self._proxy = proxy
self._looping = False
voices = [
Voice('dummy.voice1', 'John Doe', ['en-US', 'en-GB'], 'male',... | true | true |
f71785323c845db207650f7917b7bc72e98e1b96 | 26,982 | py | Python | manila/tests/share/drivers/quobyte/test_quobyte.py | deiter/manila | ba94d20e823d2edad7e9bd01546cf1642b17d212 | [
"Apache-2.0"
] | 1 | 2019-05-06T10:33:38.000Z | 2019-05-06T10:33:38.000Z | manila/tests/share/drivers/quobyte/test_quobyte.py | deiter/manila | ba94d20e823d2edad7e9bd01546cf1642b17d212 | [
"Apache-2.0"
] | 4 | 2019-05-06T11:45:17.000Z | 2019-05-09T14:23:28.000Z | manila/tests/share/drivers/quobyte/test_quobyte.py | deiter/manila | ba94d20e823d2edad7e9bd01546cf1642b17d212 | [
"Apache-2.0"
] | 3 | 2019-05-03T12:32:47.000Z | 2021-01-30T20:26:19.000Z | # Copyright (c) 2015 Quobyte, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 44.746269 | 79 | 0.552998 |
import mock
from oslo_config import cfg
import six
from manila import context
from manila import exception
from manila.share import configuration as config
from manila.share import driver
from manila.share.drivers.quobyte import jsonrpc
from manila.share.drivers.quobyte import quobyte
from manila import... | true | true |
f7178564a143b7e9c9ec5547d04715becbaafd35 | 1,183 | py | Python | scripts/pyqtgraph-develop/examples/MultiPlotWidget.py | kuldeepaman/tf-pose | 8050912c52a7b4f3c8a2656f267d47ba21d093f6 | [
"Apache-2.0"
] | null | null | null | scripts/pyqtgraph-develop/examples/MultiPlotWidget.py | kuldeepaman/tf-pose | 8050912c52a7b4f3c8a2656f267d47ba21d093f6 | [
"Apache-2.0"
] | null | null | null | scripts/pyqtgraph-develop/examples/MultiPlotWidget.py | kuldeepaman/tf-pose | 8050912c52a7b4f3c8a2656f267d47ba21d093f6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
## Add path to library (just for examples; you do not need this)
import initExample
from scipy import random
from numpy import linspace
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
from pyqtgraph import MultiPlotWidget
try:
from pyqtgraph.meta... | 28.166667 | 103 | 0.618766 |
port linspace
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
from pyqtgraph import MultiPlotWidget
try:
from pyqtgraph.metaarray import *
except:
print("MultiPlot is only used with MetaArray for now (and you do not have the metaarray package)")
exit()
app = QtGui.QApplication([])... | true | true |
f71786f5f39627c1fac7f1b3ad0367fe2a1feb53 | 1,888 | py | Python | silk-src/src/pysilk/python/_netsa_silk.py | mjschultz/netsa-pkg | 07bf4ff29a73ebc0f58e4aa27d3ad6b1dee7fc83 | [
"Apache-2.0"
] | 3 | 2018-06-01T06:55:14.000Z | 2021-11-14T22:51:04.000Z | silk-src/src/pysilk/python/_netsa_silk.py | mjschultz/netsa-pkg | 07bf4ff29a73ebc0f58e4aa27d3ad6b1dee7fc83 | [
"Apache-2.0"
] | 3 | 2017-07-02T17:03:34.000Z | 2021-09-09T17:05:31.000Z | silk-src/src/pysilk/python/_netsa_silk.py | mjschultz/netsa-pkg | 07bf4ff29a73ebc0f58e4aa27d3ad6b1dee7fc83 | [
"Apache-2.0"
] | 4 | 2017-08-14T15:42:31.000Z | 2022-01-24T16:24:27.000Z | #######################################################################
# Copyright (C) 2011-2020 by Carnegie Mellon University.
#
# @OPENSOURCE_LICENSE_START@
# See license information in ../../../LICENSE.txt
# @OPENSOURCE_LICENSE_END@
#
#######################################################################
########... | 31.466667 | 75 | 0.632945 | true | true | |
f717870bb59f4f607b6c5181895c66f109cd7bcf | 523 | py | Python | juriscraper/opinions/united_states/state/calctapp_1st.py | EvandoBlanco/juriscraper | 3d16af258620d4ba1b4827f66ef69e8a2c5a0484 | [
"BSD-2-Clause"
] | 228 | 2015-01-23T04:41:39.000Z | 2022-03-30T09:52:20.000Z | juriscraper/opinions/united_states/state/calctapp_1st.py | EvandoBlanco/juriscraper | 3d16af258620d4ba1b4827f66ef69e8a2c5a0484 | [
"BSD-2-Clause"
] | 331 | 2015-01-05T18:53:40.000Z | 2022-03-29T23:43:30.000Z | juriscraper/opinions/united_states/state/calctapp_1st.py | EvandoBlanco/juriscraper | 3d16af258620d4ba1b4827f66ef69e8a2c5a0484 | [
"BSD-2-Clause"
] | 84 | 2015-01-03T01:19:21.000Z | 2022-03-01T08:09:32.000Z | # Scraper for California's First District Court of Appeal
# CourtID: calctapp_1st
# Court Short Name: Cal. Ct. App.
from juriscraper.opinions.united_states.state import cal
class Site(cal.Site):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.court_id = self.... | 29.055556 | 57 | 0.667304 |
# CourtID: calctapp_1st
# Court Short Name: Cal. Ct. App.
from juriscraper.opinions.united_states.state import cal
class Site(cal.Site):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.court_id = self.__module__
self.court_code = "A"
self.div... | true | true |
f71787192e7a235fa2e02fbfdcda490a79b3300e | 12,258 | py | Python | source/deepsecurity/models/anti_malware_computer_extension.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-10-30T16:40:09.000Z | 2021-10-30T16:40:09.000Z | source/deepsecurity/models/anti_malware_computer_extension.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-07-28T20:19:03.000Z | 2021-07-28T20:19:03.000Z | source/deepsecurity/models/anti_malware_computer_extension.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-10-30T16:40:02.000Z | 2021-10-30T16:40:02.000Z | # coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De... | 38.186916 | 311 | 0.660548 |
import pprint
import re
import six
from deepsecurity.models.computer_module_status import ComputerModuleStatus
class AntiMalwareComputerExtension(object):
swagger_types = {
'state': 'str',
'module_status': 'ComputerModuleStatus',
'real_time_scan_configuration_id': ... | true | true |
f71787b41422d7fb8b33c9454081d2bd60c5fe8f | 1,150 | py | Python | cirq/contrib/svg/svg_test.py | lilies/Cirq | 519b8b70ba4d2d92d1c034c398161ebdbd23e2e7 | [
"Apache-2.0"
] | 3 | 2020-09-26T03:56:28.000Z | 2020-09-27T13:21:04.000Z | cirq/contrib/svg/svg_test.py | lilies/Cirq | 519b8b70ba4d2d92d1c034c398161ebdbd23e2e7 | [
"Apache-2.0"
] | 1 | 2020-08-11T15:45:17.000Z | 2020-08-11T15:45:17.000Z | cirq/contrib/svg/svg_test.py | lilies/Cirq | 519b8b70ba4d2d92d1c034c398161ebdbd23e2e7 | [
"Apache-2.0"
] | 1 | 2020-04-14T15:29:29.000Z | 2020-04-14T15:29:29.000Z | import pytest
import numpy as np
import cirq
from cirq.contrib.svg import circuit_to_svg
def test_svg():
a, b, c = cirq.LineQubit.range(3)
svg_text = circuit_to_svg(
cirq.Circuit(
cirq.CNOT(a, b),
cirq.CZ(b, c),
cirq.SWAP(a, c),
cirq.PhasedXPowGate(exp... | 26.744186 | 80 | 0.6 | import pytest
import numpy as np
import cirq
from cirq.contrib.svg import circuit_to_svg
def test_svg():
a, b, c = cirq.LineQubit.range(3)
svg_text = circuit_to_svg(
cirq.Circuit(
cirq.CNOT(a, b),
cirq.CZ(b, c),
cirq.SWAP(a, c),
cirq.PhasedXPowGate(exp... | true | true |
f71788ff490545bb580c7e52b9c71e363cbb8d15 | 6,165 | py | Python | recipes/libtool/all/test_package/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | 1 | 2021-11-11T03:07:13.000Z | 2021-11-11T03:07:13.000Z | recipes/libtool/all/test_package/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | 1 | 2021-11-22T13:54:48.000Z | 2021-11-22T14:09:45.000Z | recipes/libtool/all/test_package/conanfile.py | dpronin/conan-center-index | 5c6e41a618097d04e731c9831118a51dcb39ab3f | [
"MIT"
] | null | null | null | from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools
from contextlib import contextmanager
import glob
import os
import shutil
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
test_type = "explicit"
short_paths = True
@prop... | 40.559211 | 120 | 0.610868 | from conans import AutoToolsBuildEnvironment, CMake, ConanFile, tools
from contextlib import contextmanager
import glob
import os
import shutil
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
test_type = "explicit"
short_paths = True
@prop... | true | true |
f71789c0f44a5dca7010d4a66926c97673dff301 | 4,401 | py | Python | models/backbone.py | playerkk/HoiTransformer | b710216d6b338863ebe9d40a96765ab52780cefa | [
"Apache-2.0"
] | 107 | 2021-03-03T13:31:32.000Z | 2022-03-31T10:59:45.000Z | models/backbone.py | playerkk/HoiTransformer | b710216d6b338863ebe9d40a96765ab52780cefa | [
"Apache-2.0"
] | 37 | 2021-03-10T11:36:49.000Z | 2022-02-22T03:58:12.000Z | models/backbone.py | playerkk/HoiTransformer | b710216d6b338863ebe9d40a96765ab52780cefa | [
"Apache-2.0"
] | 19 | 2021-03-17T13:21:03.000Z | 2022-02-09T09:48:58.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Backbone modules.
"""
import torch
import torch.nn.functional as F
import torchvision
from torch import nn
from torchvision.models._utils import IntermediateLayerGetter
from typing import Dict, List
from util.misc import NestedTensor, is_main_p... | 37.29661 | 113 | 0.656669 |
import torch
import torch.nn.functional as F
import torchvision
from torch import nn
from torchvision.models._utils import IntermediateLayerGetter
from typing import Dict, List
from util.misc import NestedTensor, is_main_process
from .position_encoding import build_position_encoding
class FrozenBatchNorm2d(torch.n... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.