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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c05a9a6f87841b8c66cb306f51599d51c55b395 | 3,992 | py | Python | code/id56.py | hanfengzhai/DARPA-FFT | 61705c1dcbe7a75a54003db5e8f7db3717e3040c | [
"MIT"
] | null | null | null | code/id56.py | hanfengzhai/DARPA-FFT | 61705c1dcbe7a75a54003db5e8f7db3717e3040c | [
"MIT"
] | null | null | null | code/id56.py | hanfengzhai/DARPA-FFT | 61705c1dcbe7a75a54003db5e8f7db3717e3040c | [
"MIT"
] | null | null | null | import time
from scipy import fftpack
import book_format
book_format.set_style()
import kf_book.kf_internal as kf_internal
from kf_book.kf_internal import DogSimulation
from kf_book import book_plots as book_plots
import numpy as np
from matplotlib import pyplot
import scipy.io
import pandas as pd
import pandas_datarea... | 28.719424 | 149 | 0.716683 | import time
from scipy import fftpack
import book_format
book_format.set_style()
import kf_book.kf_internal as kf_internal
from kf_book.kf_internal import DogSimulation
from kf_book import book_plots as book_plots
import numpy as np
from matplotlib import pyplot
import scipy.io
import pandas as pd
import pandas_datarea... | true | true |
1c05aa6caa98e2ca705203c7ca02e3f460a942f1 | 69 | py | Python | mamonsu/plugins/system/windows/__init__.py | dan-aksenov/mamonsu | c4822b48974e870af91910515fd7f11e4b8b41b3 | [
"BSD-3-Clause"
] | 188 | 2016-01-31T09:05:59.000Z | 2022-03-22T16:49:12.000Z | mamonsu/plugins/system/windows/__init__.py | dan-aksenov/mamonsu | c4822b48974e870af91910515fd7f11e4b8b41b3 | [
"BSD-3-Clause"
] | 162 | 2016-02-02T13:49:14.000Z | 2022-02-22T08:45:42.000Z | mamonsu/plugins/system/windows/__init__.py | dan-aksenov/mamonsu | c4822b48974e870af91910515fd7f11e4b8b41b3 | [
"BSD-3-Clause"
] | 46 | 2016-01-31T21:23:37.000Z | 2022-02-07T10:59:54.000Z | __all__ = ['cpu', 'disk_stats', 'memory', 'network']
from . import *
| 23 | 52 | 0.623188 | __all__ = ['cpu', 'disk_stats', 'memory', 'network']
from . import *
| true | true |
1c05ab620a610a229d4dacf32f160bc4ef71bd87 | 736 | py | Python | venv/Lib/site-packages/geventwebsocket/protocols/base.py | asanka9/Quession-Discussion-App-Socket.Io-NLP | 95a49a8afa572dc3908a0bade45e424c3751f191 | [
"Apache-2.0"
] | 129 | 2015-01-06T11:02:25.000Z | 2022-03-15T03:48:18.000Z | venv/Lib/site-packages/geventwebsocket/protocols/base.py | asanka9/Quession-Discussion-App-Socket.Io-NLP | 95a49a8afa572dc3908a0bade45e424c3751f191 | [
"Apache-2.0"
] | 9 | 2021-08-14T01:27:36.000Z | 2021-08-24T18:10:18.000Z | venv/Lib/site-packages/geventwebsocket/protocols/base.py | asanka9/Quession-Discussion-App-Socket.Io-NLP | 95a49a8afa572dc3908a0bade45e424c3751f191 | [
"Apache-2.0"
] | 57 | 2015-01-13T03:49:55.000Z | 2022-01-13T09:47:11.000Z | class BaseProtocol(object):
PROTOCOL_NAME = ''
def __init__(self, app):
self._app = app
def on_open(self):
self.app.on_open()
def on_message(self, message):
self.app.on_message(message)
def on_close(self, reason=None):
self.app.on_close(reason)
@property
... | 20.444444 | 53 | 0.57337 | class BaseProtocol(object):
PROTOCOL_NAME = ''
def __init__(self, app):
self._app = app
def on_open(self):
self.app.on_open()
def on_message(self, message):
self.app.on_message(message)
def on_close(self, reason=None):
self.app.on_close(reason)
@property
... | true | true |
1c05ab79de72760ecfe09782d0c30841458ce5d1 | 1,428 | py | Python | test/functional/feature_blocksdir.py | DemoCoin-Dev/democoin | 4f3ee2a4484a05140cc1066a299afae7c120b0d2 | [
"MIT"
] | 1 | 2018-10-15T00:55:42.000Z | 2018-10-15T00:55:42.000Z | test/functional/feature_blocksdir.py | DemoCoin-Dev/democoin | 4f3ee2a4484a05140cc1066a299afae7c120b0d2 | [
"MIT"
] | null | null | null | test/functional/feature_blocksdir.py | DemoCoin-Dev/democoin | 4f3ee2a4484a05140cc1066a299afae7c120b0d2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Democoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the blocksdir option.
"""
import os
import shutil
from test_framework.test_framework import Democoin... | 38.594595 | 167 | 0.698179 |
import os
import shutil
from test_framework.test_framework import DemocoinTestFramework, initialize_datadir
class BlocksdirTest(DemocoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
def run_test(self):
self.stop_node(0)
shutil.rm... | true | true |
1c05abf7f1e3a9c8262282d2b9a1651d017d2957 | 7,601 | py | Python | src/server/logging_azure.py | bradunov/shkola | 6ef057f5bd483318bf5763392972d48de481d0fb | [
"MIT"
] | 2 | 2019-08-25T09:37:27.000Z | 2021-01-25T20:22:30.000Z | src/server/logging_azure.py | bradunov/shkola | 6ef057f5bd483318bf5763392972d48de481d0fb | [
"MIT"
] | 28 | 2019-07-04T19:53:36.000Z | 2020-10-24T13:27:56.000Z | src/server/logging_azure.py | bradunov/shkola | 6ef057f5bd483318bf5763392972d48de481d0fb | [
"MIT"
] | null | null | null | import logging
import json
#from pythonjsonlogger import jsonlogger
import requests
import datetime
import hashlib
import hmac
import base64
import os
import threading
import server.helpers as helpers
import server.context as context
# Built from the following examples:
# https://dzone.com/articles/python-custom-log... | 33.484581 | 129 | 0.617156 | import logging
import json
import requests
import datetime
import hashlib
import hmac
import base64
import os
import threading
import server.helpers as helpers
import server.context as context
class Logging_handler_azure(logging.StreamHandler):
def _build_signature(self, workspace_id, primary_key, date, ... | true | true |
1c05ac296e1f1a87bf7061a5b7cfb7bbfaa877fb | 1,964 | py | Python | dnd_gui/util/encounter.py | JStuckner/DnD-GUI-2 | bf393c94e48df2e17113046b7f917ac2176ac8e8 | [
"MIT"
] | null | null | null | dnd_gui/util/encounter.py | JStuckner/DnD-GUI-2 | bf393c94e48df2e17113046b7f917ac2176ac8e8 | [
"MIT"
] | null | null | null | dnd_gui/util/encounter.py | JStuckner/DnD-GUI-2 | bf393c94e48df2e17113046b7f917ac2176ac8e8 | [
"MIT"
] | null | null | null | from random import randint, shuffle
import numpy as np
def order(NPCI):
#print(NPCI)
#PC initiative
numPCs = 4
SethI = 10
AnastasiaI = 2
CameronI = 5
TravisI = 2
try:
numNPC = len(NPCI)
except TypeError:
numNPC = 1
#Set up matrix
order = np.zeros(numPCs+num... | 23.662651 | 95 | 0.484216 | from random import randint, shuffle
import numpy as np
def order(NPCI):
numPCs = 4
SethI = 10
AnastasiaI = 2
CameronI = 5
TravisI = 2
try:
numNPC = len(NPCI)
except TypeError:
numNPC = 1
order = np.zeros(numPCs+numNPC,
dtype=[('name',(s... | true | true |
1c05acce389e75e163f1a97e6a867b3becd9f440 | 130,712 | py | Python | Python/LeniaND.py | YINZHI-keji/Lenia | adfc542939266de7f4bb7ebb552e8499701ee107 | [
"MIT"
] | 2,153 | 2018-07-13T11:31:12.000Z | 2022-03-29T20:49:39.000Z | Python/LeniaND.py | YINZHI-keji/Lenia | adfc542939266de7f4bb7ebb552e8499701ee107 | [
"MIT"
] | 14 | 2018-02-25T08:12:23.000Z | 2021-10-13T09:28:49.000Z | Python/LeniaND.py | YINZHI-keji/Lenia | adfc542939266de7f4bb7ebb552e8499701ee107 | [
"MIT"
] | 150 | 2018-06-08T10:10:05.000Z | 2022-03-15T02:16:52.000Z | import numpy as np # pip3 install numpy
import scipy.ndimage # pip3 install scipy
import scipy.spatial.distance, scipy.signal
import reikna.fft, reikna.cluda # pip3 install pyopencl/pycuda, reikna
import PIL.Image, PIL.ImageTk # pip3 install pillow
import PIL.ImageD... | 51.562919 | 237 | 0.559291 | import numpy as np import scipy.ndimage import scipy.spatial.distance, scipy.signal
import reikna.fft, reikna.cluda import PIL.Image, PIL.ImageTk import PIL.ImageDraw, PIL.ImageFont
try: import tkinter as tk
except: import Tkinter as tk
from fractions import Fractio... | true | true |
1c05ad54232168e95bce2d346eee40f6ca14914b | 4,900 | py | Python | split/split_atomic2020.py | anudeep23/CS7634-FinalProject-COMET2020 | ef86531719a9016f2597516d84dbcf010fb8699c | [
"Apache-2.0"
] | 94 | 2021-02-16T07:55:54.000Z | 2022-03-19T14:58:45.000Z | split/split_atomic2020.py | anudeep23/CS7634-FinalProject-COMET2020 | ef86531719a9016f2597516d84dbcf010fb8699c | [
"Apache-2.0"
] | 12 | 2021-02-20T04:45:27.000Z | 2022-03-10T18:26:35.000Z | split/split_atomic2020.py | anudeep23/CS7634-FinalProject-COMET2020 | ef86531719a9016f2597516d84dbcf010fb8699c | [
"Apache-2.0"
] | 23 | 2021-02-17T07:31:15.000Z | 2022-03-30T22:15:06.000Z | import argparse
import random
from utils import read_csv, write_array2tsv, head_based_split, get_head_set
def load_atomic2020(args):
random.seed(args.random_seed)
atomic2020_v1_file = args.data_folder + "atomic_original_tuples.tsv"
atomic2020_addl_file = args.data_folder + "atomic_additional_tuples.tsv"... | 44.954128 | 127 | 0.642245 | import argparse
import random
from utils import read_csv, write_array2tsv, head_based_split, get_head_set
def load_atomic2020(args):
random.seed(args.random_seed)
atomic2020_v1_file = args.data_folder + "atomic_original_tuples.tsv"
atomic2020_addl_file = args.data_folder + "atomic_additional_tuples.tsv"... | true | true |
1c05ae4715cf72c998d0789c2f778d09ca8dc3d0 | 1,235 | py | Python | Assignment1/partners_example.py | yufeng97/CSSE1001_Assignments | d66681456d8555ce3cdee80da1adde033798d72e | [
"MIT"
] | null | null | null | Assignment1/partners_example.py | yufeng97/CSSE1001_Assignments | d66681456d8555ce3cdee80da1adde033798d72e | [
"MIT"
] | null | null | null | Assignment1/partners_example.py | yufeng97/CSSE1001_Assignments | d66681456d8555ce3cdee80da1adde033798d72e | [
"MIT"
] | null | null | null | """This is a simple example of using the partners.py file.
The partners.py file allows you to retrieve each potential partner
from the database. The one restriction is that you must finish getting
details of the potential partner before checking to see if there are
any more potential partners available.
"""
# The fo... | 42.586207 | 84 | 0.792713 |
import partners
potential_partners = partners.Partners()
while potential_partners.available() :
print(potential_partners.get_name())
print(potential_partners.get_gender())
print(potential_partners.get_sexual_pref())
print(potential_partners.get_height())
print(potential_partners.get_height_pref()... | true | true |
1c05b2165a85e0d56bb91d5d1b536ff37b5552af | 255 | py | Python | config.py | AndreyAD1/forum | bae8bee6c45ca53b717c661a4dc624fec05aca35 | [
"MIT"
] | null | null | null | config.py | AndreyAD1/forum | bae8bee6c45ca53b717c661a4dc624fec05aca35 | [
"MIT"
] | null | null | null | config.py | AndreyAD1/forum | bae8bee6c45ca53b717c661a4dc624fec05aca35 | [
"MIT"
] | null | null | null | import os
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
class Config:
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
SQLALCHEMY_TRACK_MODIFICATIONS = False
VERBOSE = bool(os.environ.get('VERBOSE_FLASK'))
| 21.25 | 60 | 0.772549 | import os
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
class Config:
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
SQLALCHEMY_TRACK_MODIFICATIONS = False
VERBOSE = bool(os.environ.get('VERBOSE_FLASK'))
| true | true |
1c05b2231c14df79c5a210af8cae190c35e2af05 | 12,340 | py | Python | Lib/asyncio/futures.py | picen/mi-primer-blog | e304130788ae7370575b65b240bcec9c70bf9f52 | [
"bzip2-1.0.6"
] | null | null | null | Lib/asyncio/futures.py | picen/mi-primer-blog | e304130788ae7370575b65b240bcec9c70bf9f52 | [
"bzip2-1.0.6"
] | null | null | null | Lib/asyncio/futures.py | picen/mi-primer-blog | e304130788ae7370575b65b240bcec9c70bf9f52 | [
"bzip2-1.0.6"
] | null | null | null | """A Future class similar to the one in PEP 3148."""
__all__ = (
'CancelledError', 'TimeoutError', 'InvalidStateError',
'Future', 'wrap_future', 'isfuture',
)
import concurrent.futures
import logging
import sys
from . import base_futures
from . import events
from . import format_helpers
CancelledError = ba... | 32.473684 | 79 | 0.642869 |
__all__ = (
'CancelledError', 'TimeoutError', 'InvalidStateError',
'Future', 'wrap_future', 'isfuture',
)
import concurrent.futures
import logging
import sys
from . import base_futures
from . import events
from . import format_helpers
CancelledError = base_futures.CancelledError
InvalidStateError = base_fu... | true | true |
1c05b38ac22cb9355f8813e436d2c2ba3dd3b234 | 14,732 | py | Python | frappe/tests/test_commands.py | alijasim/frappe | 17803d5408d0a0257ab6968acb1a847a582b07ce | [
"MIT"
] | null | null | null | frappe/tests/test_commands.py | alijasim/frappe | 17803d5408d0a0257ab6968acb1a847a582b07ce | [
"MIT"
] | 17 | 2021-03-22T18:47:14.000Z | 2022-03-15T12:21:00.000Z | frappe/tests/test_commands.py | alijasim/frappe | 17803d5408d0a0257ab6968acb1a847a582b07ce | [
"MIT"
] | null | null | null | # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# imports - standard imports
import gzip
import json
import os
import shlex
import subprocess
import sys
import unittest
import glob
# imports - module imports
import frappe
import frappe.recorder
from frappe.installer import add_to_installed_apps
f... | 33.558087 | 117 | 0.708322 |
import gzip
import json
import os
import shlex
import subprocess
import sys
import unittest
import glob
import frappe
import frappe.recorder
from frappe.installer import add_to_installed_apps
from frappe.utils import add_to_date, get_bench_relative_path, now
from frappe.utils.backups import fetch_latest_backups
def... | true | true |
1c05b3f007d14ea422eb3c52f5f4df435dd832ed | 10,054 | py | Python | contrib/spendfrom/spendfrom.py | oscintcoin/osc | 1ee39ed739b241b831bb33fdf04ea197853f8ec0 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | oscintcoin/osc | 1ee39ed739b241b831bb33fdf04ea197853f8ec0 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | oscintcoin/osc | 1ee39ed739b241b831bb33fdf04ea197853f8ec0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | 37.514925 | 111 | 0.632286 |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis... | true | true |
1c05b3f9ad595781a1992418fb4a586efcc925e9 | 1,302 | py | Python | idaes/gas_solid_contactors/properties/methane_iron_OC_reduction/solid_phase_thermo.py | OOAmusat/idaes-pse | ae7d3bb8e372bc32822dcdcb75e9fd96b78da539 | [
"RSA-MD"
] | null | null | null | idaes/gas_solid_contactors/properties/methane_iron_OC_reduction/solid_phase_thermo.py | OOAmusat/idaes-pse | ae7d3bb8e372bc32822dcdcb75e9fd96b78da539 | [
"RSA-MD"
] | null | null | null | idaes/gas_solid_contactors/properties/methane_iron_OC_reduction/solid_phase_thermo.py | OOAmusat/idaes-pse | ae7d3bb8e372bc32822dcdcb75e9fd96b78da539 | [
"RSA-MD"
] | null | null | null | #################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | 54.25 | 118 | 0.680492 | from pyomo.common.deprecation import deprecation_warning
deprecation_warning("The gas_solid_contactors.properties.methane_iron_OC_reduction.solid_phase_thermo "
"module has been moved to "
"idaes.models_extra.gas_solid_contactors.properties.methane_iron_OC_reduction.solid_phase_... | true | true |
1c05b44771c8d7932b1b61f5a5253aba6aaf94cf | 2,252 | py | Python | ucscsdk/mometa/policy/PolicyStorageAutoConfig.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/policy/PolicyStorageAutoConfig.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/policy/PolicyStorageAutoConfig.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for PolicyStorageAutoConfig ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class PolicyStorageAutoConfigConsts():
SOURCE_LOCAL = "local"
SOURCE_PENDING_PO... | 47.914894 | 275 | 0.678508 |
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class PolicyStorageAutoConfigConsts():
SOURCE_LOCAL = "local"
SOURCE_PENDING_POLICY = "pending-policy"
SOURCE_POLICY = "policy"
SOURCE_UNSPECIFIED = "unspecified"
... | true | true |
1c05b53212805680fd61561e69737f81b464cbe3 | 1,008 | py | Python | birbcam/optionflipper.py | jdpdev/birbcam | b44c95744d81d063f12dfb2521019ff89787c45a | [
"MIT"
] | 11 | 2021-03-19T18:58:19.000Z | 2022-03-23T16:57:06.000Z | birbcam/optionflipper.py | jdpdev/birbcam | b44c95744d81d063f12dfb2521019ff89787c45a | [
"MIT"
] | 13 | 2021-03-16T00:44:52.000Z | 2021-08-31T01:44:30.000Z | birbcam/optionflipper.py | jdpdev/birbcam | b44c95744d81d063f12dfb2521019ff89787c45a | [
"MIT"
] | 3 | 2021-03-12T15:56:14.000Z | 2022-01-03T19:41:17.000Z | class OptionFlipper:
def __init__(self, options, start = 0, labels = None):
self.options = options
self.index = start
self.labels = labels
@property
def value(self):
return self.options[self.index]
@property
def label(self):
if self.labels == None:
... | 22.909091 | 58 | 0.540675 | class OptionFlipper:
def __init__(self, options, start = 0, labels = None):
self.options = options
self.index = start
self.labels = labels
@property
def value(self):
return self.options[self.index]
@property
def label(self):
if self.labels == None:
... | true | true |
1c05b59f079b78ee098b592265984e5c9bd87e3b | 751 | py | Python | discord/main.py | donno2048/mp4-to-unicode | 5057d5efeed27a61e4ffe1bd5f7b46fb27f02195 | [
"MIT"
] | null | null | null | discord/main.py | donno2048/mp4-to-unicode | 5057d5efeed27a61e4ffe1bd5f7b46fb27f02195 | [
"MIT"
] | null | null | null | discord/main.py | donno2048/mp4-to-unicode | 5057d5efeed27a61e4ffe1bd5f7b46fb27f02195 | [
"MIT"
] | null | null | null | from discord.ext import commands
from sys import argv
bot, code_indicate = commands.Bot(command_prefix='>'), '`' * 3
@bot.command()
async def play(ctx):
message = await ctx.send(code_indicate + "\n" + code_indicate)
for i in open(argv[1]).read().split("."): await message.edit(content=code_indicate + "\n" ... | 68.272727 | 367 | 0.659121 | from discord.ext import commands
from sys import argv
bot, code_indicate = commands.Bot(command_prefix='>'), '`' * 3
@bot.command()
async def play(ctx):
message = await ctx.send(code_indicate + "\n" + code_indicate)
for i in open(argv[1]).read().split("."): await message.edit(content=code_indicate + "\n" ... | true | true |
1c05b62a4618ddbe5b50de3152122529187c5232 | 16,939 | py | Python | xmas_lights.py | guqin/xmas2020 | 04ec60b39fcf8df4f84e954c61f8562e8821a98b | [
"MIT"
] | null | null | null | xmas_lights.py | guqin/xmas2020 | 04ec60b39fcf8df4f84e954c61f8562e8821a98b | [
"MIT"
] | null | null | null | xmas_lights.py | guqin/xmas2020 | 04ec60b39fcf8df4f84e954c61f8562e8821a98b | [
"MIT"
] | null | null | null | # some code adapted from DanStach/rpi-ws2811
import time
import board
import neopixel
import requests
import blynklib
import random
import multiprocessing as mp
import numpy as np
BLYNK_AUTH = open('blynk_auth.txt').read().strip()
# initialize blynk
blynk = blynklib.Blynk(BLYNK_AUTH)
# Choose an o... | 33.743028 | 152 | 0.573529 | import time
import board
import neopixel
import requests
import blynklib
import random
import multiprocessing as mp
import numpy as np
BLYNK_AUTH = open('blynk_auth.txt').read().strip()
blynk = blynklib.Blynk(BLYNK_AUTH)
pixel_pin = board.D18
num_pixels = 50
ORDER = neopixel.RGB
pixels = ne... | true | true |
1c05b6ce9f13e898230337a4df21d271744932b9 | 1,250 | py | Python | try/test_not_exist_in_vocab.py | searobbersduck/ResumeAnalyze | 984484dd1c6af090ae1b7854bc931e06a9294586 | [
"MIT"
] | null | null | null | try/test_not_exist_in_vocab.py | searobbersduck/ResumeAnalyze | 984484dd1c6af090ae1b7854bc931e06a9294586 | [
"MIT"
] | null | null | null | try/test_not_exist_in_vocab.py | searobbersduck/ResumeAnalyze | 984484dd1c6af090ae1b7854bc931e06a9294586 | [
"MIT"
] | null | null | null | # !/usr/bin/env python2
# -*- coding:utf-8 -*-
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os
infile = 'out/eduexpr_x.txt'
invocab = '../extsrc/ttt_vocab.txt'
def loadvocab(vocabfile, vocab):
idx = 0
with open(vocabfile, 'r') as f:
... | 23.148148 | 45 | 0.512 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os
infile = 'out/eduexpr_x.txt'
invocab = '../extsrc/ttt_vocab.txt'
def loadvocab(vocabfile, vocab):
idx = 0
with open(vocabfile, 'r') as f:
for line in f.readlines():
if n... | true | true |
1c05b71d1a2b2ca108daef09453fd0ab4a559e12 | 3,049 | py | Python | api-flask/api/v1/views/auth.py | jmg7173/boiler-plates-and-examples | 6df2b79f8c56422b6612210e51edaf26e423e5b0 | [
"MIT"
] | 8 | 2021-12-07T13:18:37.000Z | 2022-01-11T13:27:20.000Z | api-flask/api/v1/views/auth.py | jmg7173/boiler-plates-and-examples | 6df2b79f8c56422b6612210e51edaf26e423e5b0 | [
"MIT"
] | 22 | 2021-12-26T08:56:58.000Z | 2022-03-31T19:57:48.000Z | api-flask/api/v1/views/auth.py | jmg7173/boiler-plates-and-examples | 6df2b79f8c56422b6612210e51edaf26e423e5b0 | [
"MIT"
] | null | null | null | import os
from typing import Union, Tuple
import redis
from flask import Blueprint, request, jsonify, Response
from flask_jwt_extended import (
create_access_token,
create_refresh_token,
jwt_required, get_jwt, get_jwt_identity,
)
from app import jwt
from config import Config, get_config
from models import... | 28.495327 | 81 | 0.668416 | import os
from typing import Union, Tuple
import redis
from flask import Blueprint, request, jsonify, Response
from flask_jwt_extended import (
create_access_token,
create_refresh_token,
jwt_required, get_jwt, get_jwt_identity,
)
from app import jwt
from config import Config, get_config
from models import... | true | true |
1c05b7c5a67e864b6ed94655b997d448674e500f | 433 | py | Python | s2_move_gtests.py | SquarerFive/s2_move_tests | 5115f6723af59327ead2ce71b4f7de40a75d510b | [
"Apache-2.0"
] | null | null | null | s2_move_gtests.py | SquarerFive/s2_move_tests | 5115f6723af59327ead2ce71b4f7de40a75d510b | [
"Apache-2.0"
] | null | null | null | s2_move_gtests.py | SquarerFive/s2_move_tests | 5115f6723af59327ead2ce71b4f7de40a75d510b | [
"Apache-2.0"
] | null | null | null | import os
import pathlib
import shutil
if __name__ == "__main__":
p = pathlib.Path('tests/')
p.mkdir(parents=True, exist_ok=True)
dest_path = 'tests/{file}'
for root, dirs, files in os.walk('s2/'):
for file in files:
if '_test' in file or 'testing' in file:
pri... | 28.866667 | 84 | 0.593533 | import os
import pathlib
import shutil
if __name__ == "__main__":
p = pathlib.Path('tests/')
p.mkdir(parents=True, exist_ok=True)
dest_path = 'tests/{file}'
for root, dirs, files in os.walk('s2/'):
for file in files:
if '_test' in file or 'testing' in file:
pri... | true | true |
1c05b80bf4281c70f7678286ed53885a9ba5c56e | 1,280 | py | Python | alyBlog/apps/course/views.py | Hx-someone/aly-blog | e0205777d2ff1642fde5741a5b5c1b06ad675001 | [
"WTFPL"
] | 1 | 2020-04-17T02:15:45.000Z | 2020-04-17T02:15:45.000Z | alyBlog/apps/course/views.py | Hx-someone/aly-blog | e0205777d2ff1642fde5741a5b5c1b06ad675001 | [
"WTFPL"
] | null | null | null | alyBlog/apps/course/views.py | Hx-someone/aly-blog | e0205777d2ff1642fde5741a5b5c1b06ad675001 | [
"WTFPL"
] | null | null | null | from django.shortcuts import render
from course import models
from django.http import Http404
from django.views import View
class CourseIndexView(View):
"""
course index view
"""
def get(self, request):
# 获取课程列表中需要的数据:课程标题,讲师姓名,讲师职位
course_list = models.Course.objects.select_related(... | 32.820513 | 117 | 0.56875 | from django.shortcuts import render
from course import models
from django.http import Http404
from django.views import View
class CourseIndexView(View):
def get(self, request):
course_list = models.Course.objects.select_related("teacher").only("name", "teacher__name",
... | true | true |
1c05b83bd0fa2c91088e9ccc6012b19770463c8b | 13,128 | py | Python | brownie/convert/datatypes.py | Ignas/brownie | 1b04532af8a5db2fbdf58519684dd04cab77725a | [
"MIT"
] | null | null | null | brownie/convert/datatypes.py | Ignas/brownie | 1b04532af8a5db2fbdf58519684dd04cab77725a | [
"MIT"
] | null | null | null | brownie/convert/datatypes.py | Ignas/brownie | 1b04532af8a5db2fbdf58519684dd04cab77725a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from copy import deepcopy
from decimal import Decimal
from typing import Any, Dict, ItemsView, KeysView, List, Optional, Sequence, TypeVar, Union
import eth_utils
from hexbytes import HexBytes
UNITS = {
"wei": 0,
"kwei": 3,
"babbage": 3,
"mwei": 6,
"lovelace": 6,
"gwei": 9,... | 33.835052 | 100 | 0.593617 |
from copy import deepcopy
from decimal import Decimal
from typing import Any, Dict, ItemsView, KeysView, List, Optional, Sequence, TypeVar, Union
import eth_utils
from hexbytes import HexBytes
UNITS = {
"wei": 0,
"kwei": 3,
"babbage": 3,
"mwei": 6,
"lovelace": 6,
"gwei": 9,
"shannon": 9,
... | true | true |
1c05b85bbfc4b37d17005cd3275c34acaad7ecf9 | 2,880 | py | Python | utils/model.py | hypnaceae/FastSpeech2-Puppetry | a7473998a6e0d455fbc7c77549294a79e9c29d5f | [
"MIT"
] | null | null | null | utils/model.py | hypnaceae/FastSpeech2-Puppetry | a7473998a6e0d455fbc7c77549294a79e9c29d5f | [
"MIT"
] | null | null | null | utils/model.py | hypnaceae/FastSpeech2-Puppetry | a7473998a6e0d455fbc7c77549294a79e9c29d5f | [
"MIT"
] | null | null | null | import os
import json
import torch
import numpy as np
import hifigan
from model import FastSpeech2, ScheduledOptim
def get_model(args, configs, device, train=False):
(preprocess_config, model_config, train_config) = configs
model = FastSpeech2(preprocess_config, model_config).to(device)
if args.restore... | 30.967742 | 143 | 0.619097 | import os
import json
import torch
import numpy as np
import hifigan
from model import FastSpeech2, ScheduledOptim
def get_model(args, configs, device, train=False):
(preprocess_config, model_config, train_config) = configs
model = FastSpeech2(preprocess_config, model_config).to(device)
if args.restore... | true | true |
1c05b96f1fc61234028e940f6403ae08a0186027 | 11,866 | py | Python | python/paddle/fluid/tests/unittests/test_pool1d_api.py | zhupengyang/Paddle | ad6e3dd69cd915dd61287e96de7ec4ae132d24a5 | [
"Apache-2.0"
] | 1 | 2021-12-27T02:41:23.000Z | 2021-12-27T02:41:23.000Z | python/paddle/fluid/tests/unittests/test_pool1d_api.py | zlsh80826/Paddle | c560a7d57aad990f374ebadd330351f18e2ca65f | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_pool1d_api.py | zlsh80826/Paddle | c560a7d57aad990f374ebadd330351f18e2ca65f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. 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 by appli... | 38.277419 | 80 | 0.533204 |
import numpy as np
import unittest
import numpy as np
from op_test import OpTest
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid import compiler, Program, program_guard
import paddle
import paddle.nn.functional as F
import paddle.fluid as fluid
def adaptive_start_index(index, input_si... | true | true |
1c05bc96b7a8740285f5083d91b21c64860be744 | 3,540 | py | Python | modules/LanguageUnderstanding/utils/utils.py | maeharin/HotPepperGourmetDialogue | dd8e8fd3ed64ea42a7cc6f2ef6fa0a1fccd73786 | [
"MIT"
] | null | null | null | modules/LanguageUnderstanding/utils/utils.py | maeharin/HotPepperGourmetDialogue | dd8e8fd3ed64ea42a7cc6f2ef6fa0a1fccd73786 | [
"MIT"
] | null | null | null | modules/LanguageUnderstanding/utils/utils.py | maeharin/HotPepperGourmetDialogue | dd8e8fd3ed64ea42a7cc6f2ef6fa0a1fccd73786 | [
"MIT"
] | null | null | null | def is_hiragana(ch):
return 0x3040 <= ord(ch) <= 0x309F
def is_katakana(ch):
return 0x30A0 <= ord(ch) <= 0x30FF
def get_character_type(ch):
if ch.isspace():
return 'ZSPACE'
elif ch.isdigit():
return 'ZDIGIT'
elif ch.islower():
return 'ZLLET'
elif ch.isupper():
... | 23.137255 | 78 | 0.559887 | def is_hiragana(ch):
return 0x3040 <= ord(ch) <= 0x309F
def is_katakana(ch):
return 0x30A0 <= ord(ch) <= 0x30FF
def get_character_type(ch):
if ch.isspace():
return 'ZSPACE'
elif ch.isdigit():
return 'ZDIGIT'
elif ch.islower():
return 'ZLLET'
elif ch.isupper():
... | true | true |
1c05bd27e22dcec954ad5ac52e5160ed51d5fccd | 211 | py | Python | MFRC522/Read.py | vioreltyiran/nodejs-licenta | d527fb894aa6af44b2f42025dfd22f8762650dc7 | [
"MIT"
] | 1 | 2018-06-05T12:30:08.000Z | 2018-06-05T12:30:08.000Z | MFRC522/Read.py | vioreltyiran/nodejs-licenta | d527fb894aa6af44b2f42025dfd22f8762650dc7 | [
"MIT"
] | null | null | null | MFRC522/Read.py | vioreltyiran/nodejs-licenta | d527fb894aa6af44b2f42025dfd22f8762650dc7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import RPi.GPIO as GPIO
import SimpleMFRC522
reader = SimpleMFRC522.SimpleMFRC522()
try:
id, text = reader.read()
print(id)
print(text)
finally:
GPIO.cleanup()
| 14.066667 | 38 | 0.654028 |
import RPi.GPIO as GPIO
import SimpleMFRC522
reader = SimpleMFRC522.SimpleMFRC522()
try:
id, text = reader.read()
print(id)
print(text)
finally:
GPIO.cleanup()
| false | true |
1c05c05065e8ea6f19da19d8e7f0473755650c6e | 3,942 | py | Python | Visualisation/annealingColumnChartGrid.py | Mustrumion/MastersDegreeProjects | 5d389dbcb80d91888b7d4d38034ec9d33e496fba | [
"MIT"
] | 2 | 2019-07-17T15:18:21.000Z | 2019-07-17T16:05:00.000Z | Visualisation/annealingColumnChartGrid.py | Mustrumion/MastersDegreeProjects | 5d389dbcb80d91888b7d4d38034ec9d33e496fba | [
"MIT"
] | null | null | null | Visualisation/annealingColumnChartGrid.py | Mustrumion/MastersDegreeProjects | 5d389dbcb80d91888b7d4d38034ec9d33e496fba | [
"MIT"
] | null | null | null | import glob
import json
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import math
import os
from matplotlib import rcParams
# rcParams.update({'figure.autolayout': True})
def get_hours(time_str : str) -> float:
"""Get hours from time."""
h, m, s = time_str.split('... | 37.542857 | 195 | 0.648909 | import glob
import json
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import math
import os
from matplotlib import rcParams
def get_hours(time_str : str) -> float:
h, m, s = time_str.split(':')
s = s.split('.')[0]
return int(h) + int(m) / 60 + int(s) / 3600
... | true | true |
1c05c56624daa04a0f9e00da83dcc8b330254a1a | 4,656 | py | Python | rainbownum/RainbowCartesianSumsSim.py | swagner648/rainbownums | ec801b13565cdc92aa43b7ca03cdfd2a09b08ef9 | [
"MIT"
] | null | null | null | rainbownum/RainbowCartesianSumsSim.py | swagner648/rainbownums | ec801b13565cdc92aa43b7ca03cdfd2a09b08ef9 | [
"MIT"
] | null | null | null | rainbownum/RainbowCartesianSumsSim.py | swagner648/rainbownums | ec801b13565cdc92aa43b7ca03cdfd2a09b08ef9 | [
"MIT"
] | null | null | null | from .RainbowSim import RainbowSim
import numpy as np
class RbCartesianSumsEq(RainbowSim):
def __init__(self, m, n, a, b=[0, 0]):
super(RbCartesianSumsEq, self).__init__(m * n, a, Point(b[0], b[1]), False)
self.M = m # rows
self.N = n # columns
self.sums = self.sets
self.... | 35.541985 | 122 | 0.466065 | from .RainbowSim import RainbowSim
import numpy as np
class RbCartesianSumsEq(RainbowSim):
def __init__(self, m, n, a, b=[0, 0]):
super(RbCartesianSumsEq, self).__init__(m * n, a, Point(b[0], b[1]), False)
self.M = m self.N = n self.sums = self.sets
self.__generate_sums()... | true | true |
1c05c5921de763943d0bfc11b05c907f82a743d7 | 29,918 | py | Python | tests/migrations.py | Walicen/peewee | e9c8bbf912903e167e052d07f6247801dd0346aa | [
"MIT"
] | 1 | 2019-05-06T08:20:41.000Z | 2019-05-06T08:20:41.000Z | tests/migrations.py | Walicen/peewee | e9c8bbf912903e167e052d07f6247801dd0346aa | [
"MIT"
] | null | null | null | tests/migrations.py | Walicen/peewee | e9c8bbf912903e167e052d07f6247801dd0346aa | [
"MIT"
] | null | null | null | import datetime
import os
from functools import partial
from peewee import *
from playhouse.migrate import *
from .base import BaseTestCase
from .base import IS_MYSQL
from .base import IS_SQLITE
from .base import ModelTestCase
from .base import TestModel
from .base import db
from .base import requires_models
from .bas... | 36.352369 | 79 | 0.57915 | import datetime
import os
from functools import partial
from peewee import *
from playhouse.migrate import *
from .base import BaseTestCase
from .base import IS_MYSQL
from .base import IS_SQLITE
from .base import ModelTestCase
from .base import TestModel
from .base import db
from .base import requires_models
from .bas... | true | true |
1c05c5ff0b36465e31310c83cdf3e685e0a26774 | 627 | py | Python | manage.py | aaroncohen/sutrofm | e7149d268ac0ca3dfca056ece163a3e31ebcecc3 | [
"MIT"
] | null | null | null | manage.py | aaroncohen/sutrofm | e7149d268ac0ca3dfca056ece163a3e31ebcecc3 | [
"MIT"
] | null | null | null | manage.py | aaroncohen/sutrofm | e7149d268ac0ca3dfca056ece163a3e31ebcecc3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sutrofm.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Import... | 28.5 | 73 | 0.682616 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sutrofm.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 installed and "
... | true | true |
1c05c7d24f5a0b5894a17cfc0e0bd7c4ee82589a | 7,188 | py | Python | Assignment/Assignment 1/Assignment1.py | SCGTall/CS6375MachineLearning | 50ff7348eb583113b17084775a8679ce135c0487 | [
"MIT"
] | null | null | null | Assignment/Assignment 1/Assignment1.py | SCGTall/CS6375MachineLearning | 50ff7348eb583113b17084775a8679ce135c0487 | [
"MIT"
] | null | null | null | Assignment/Assignment 1/Assignment1.py | SCGTall/CS6375MachineLearning | 50ff7348eb583113b17084775a8679ce135c0487 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
# The true function
def f_true(x: float) -> float:
return 6.0 * (np.sin(x + 2) + np.sin(2 * x + 4))
# Get data points
#np.random.seed(1) # This c... | 50.619718 | 125 | 0.609488 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
def f_true(x: float) -> float:
return 6.0 * (np.sin(x + 2) + np.sin(2 * x + 4))
n = 750 x = np.random.uniform(-7.5, 7.5, n) e = np.ran... | true | true |
1c05c95e1ebde5c2c76dc51197b912538855cfbe | 369 | py | Python | bookwyrm/migrations/0072_remove_work_default_edition.py | mouse-reeve/fedireads | e3471fcc3500747a1b1deaaca662021aae5b08d4 | [
"CC0-1.0"
] | 270 | 2020-01-27T06:06:07.000Z | 2020-06-21T00:28:18.000Z | bookwyrm/migrations/0072_remove_work_default_edition.py | mouse-reeve/fedireads | e3471fcc3500747a1b1deaaca662021aae5b08d4 | [
"CC0-1.0"
] | 158 | 2020-02-10T20:36:54.000Z | 2020-06-26T17:12:54.000Z | bookwyrm/migrations/0072_remove_work_default_edition.py | mouse-reeve/fedireads | e3471fcc3500747a1b1deaaca662021aae5b08d4 | [
"CC0-1.0"
] | 15 | 2020-02-13T21:53:33.000Z | 2020-06-17T16:52:46.000Z | # Generated by Django 3.2 on 2021-04-28 22:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0071_merge_0063_auto_20210407_0045_0070_auto_20210423_0121"),
]
operations = [
migrations.RemoveField(
model_name="work",
... | 20.5 | 83 | 0.639566 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0071_merge_0063_auto_20210407_0045_0070_auto_20210423_0121"),
]
operations = [
migrations.RemoveField(
model_name="work",
name="default_edition",
),
... | true | true |
1c05c966f43f0989f0d4cd426642200e8c6382e7 | 952 | py | Python | openrec/tf1/utils/samplers/random_pointwise_sampler.py | pbaiz/openrec | a00de2345844858194ef43ab6845342114a5be93 | [
"Apache-2.0"
] | 399 | 2018-01-04T15:24:02.000Z | 2022-03-31T09:39:05.000Z | openrec/tf1/utils/samplers/random_pointwise_sampler.py | pbaiz/openrec | a00de2345844858194ef43ab6845342114a5be93 | [
"Apache-2.0"
] | 26 | 2018-01-14T04:01:28.000Z | 2022-02-09T23:36:32.000Z | openrec/tf1/utils/samplers/random_pointwise_sampler.py | pbaiz/openrec | a00de2345844858194ef43ab6845342114a5be93 | [
"Apache-2.0"
] | 97 | 2017-12-22T07:07:35.000Z | 2022-01-24T19:04:02.000Z | import numpy as np
import random
from openrec.tf1.utils.samplers import Sampler
def RandomPointwiseSampler(dataset, batch_size, num_process=5, seed=100):
random.seed(seed)
def batch(dataset, batch_size=batch_size):
while True:
input_npy = np.zeros(batch_size, dtype=[('user_id'... | 39.666667 | 79 | 0.55042 | import numpy as np
import random
from openrec.tf1.utils.samplers import Sampler
def RandomPointwiseSampler(dataset, batch_size, num_process=5, seed=100):
random.seed(seed)
def batch(dataset, batch_size=batch_size):
while True:
input_npy = np.zeros(batch_size, dtype=[('user_id'... | true | true |
1c05c9a774a95a37f1a55bd38a89129b4ef5c95f | 1,821 | py | Python | adb/linux/platform-tools/systrace/catapult/telemetry/third_party/modulegraph/modulegraph_tests/test_pycompat_pkg.py | llaske/sugarizer-deployment-tool-desktop | 34df1a56b68b15b6771671f87ab66586d60c514a | [
"Apache-2.0"
] | 1 | 2019-01-17T19:03:17.000Z | 2019-01-17T19:03:17.000Z | adb/MACOS/platform-tools/systrace/catapult/telemetry/third_party/modulegraph/modulegraph_tests/test_pycompat_pkg.py | llaske/sugarizer-deployment-tool-desktop | 34df1a56b68b15b6771671f87ab66586d60c514a | [
"Apache-2.0"
] | 2 | 2017-09-08T20:26:05.000Z | 2017-09-08T20:29:07.000Z | adb/windows/platform-tools/systrace/catapult/telemetry/third_party/modulegraph/modulegraph_tests/test_pycompat_pkg.py | llaske/sugarizer-deployment-tool-desktop | 34df1a56b68b15b6771671f87ab66586d60c514a | [
"Apache-2.0"
] | null | null | null | """
Test for import machinery
"""
import unittest
import sys
import textwrap
import subprocess
import os
from modulegraph import modulegraph
class TestModuleGraphImport (unittest.TestCase):
if not hasattr(unittest.TestCase, 'assertIsInstance'):
def assertIsInstance(self, value, types):
if not i... | 29.852459 | 72 | 0.62603 | import unittest
import sys
import textwrap
import subprocess
import os
from modulegraph import modulegraph
class TestModuleGraphImport (unittest.TestCase):
if not hasattr(unittest.TestCase, 'assertIsInstance'):
def assertIsInstance(self, value, types):
if not isinstance(value, types):
... | true | true |
1c05caa06f22a8588f3a6abc4d548ed014ef5a08 | 6,744 | py | Python | kubernetes/client/models/v1beta2_controller_revision_list.py | sgwilliams-ebsco/python | 35e6406536c96d4769ff7e2a02bf0fdcb902a509 | [
"Apache-2.0"
] | 1 | 2021-06-10T23:44:11.000Z | 2021-06-10T23:44:11.000Z | kubernetes/client/models/v1beta2_controller_revision_list.py | sgwilliams-ebsco/python | 35e6406536c96d4769ff7e2a02bf0fdcb902a509 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1beta2_controller_revision_list.py | sgwilliams-ebsco/python | 35e6406536c96d4769ff7e2a02bf0fdcb902a509 | [
"Apache-2.0"
] | 1 | 2018-11-06T16:33:43.000Z | 2018-11-06T16:33:43.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 31.811321 | 281 | 0.620403 |
from pprint import pformat
from six import iteritems
import re
class V1beta2ControllerRevisionList(object):
swagger_types = {
'api_version': 'str',
'items': 'list[V1beta2ControllerRevision]',
'kind': 'str',
'metadata': 'V1ListMeta'
}
attribute_map = {
'api_ver... | true | true |
1c05caa402c7f483761e9db9f1fd997c6f9c1314 | 34,268 | py | Python | src/QMCTools/PyscfToQmcpack_Spline.py | djstaros/qmcpack | 280f67e638bae280448b47fa618f05b848c530d2 | [
"NCSA"
] | null | null | null | src/QMCTools/PyscfToQmcpack_Spline.py | djstaros/qmcpack | 280f67e638bae280448b47fa618f05b848c530d2 | [
"NCSA"
] | 3 | 2019-11-05T16:26:14.000Z | 2022-03-09T18:32:59.000Z | src/QMCTools/PyscfToQmcpack_Spline.py | djstaros/qmcpack | 280f67e638bae280448b47fa618f05b848c530d2 | [
"NCSA"
] | null | null | null | ######################################################################################
## This file is distributed under the University of Illinois/NCSA Open Source License.
## See LICENSE file in top directory for details.
##
## Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
##
## File developed by: Yubo "Pau... | 36.339343 | 140 | 0.626153 |
import numpy as np
import h5py
import os
try:
from lxml import etree
except:
import sys
sys.exit("Error: lxml module is needed for the generation of the XML file. Please install it using your favorite package manager")
try:
import pandas as pd
except:
import sys
sys.exit("Error: Panda module is needed for... | true | true |
1c05cc7253a59422c48bad19ecfd0cb74ad0a7d2 | 11,045 | py | Python | frappe/custom/doctype/customize_form/customize_form.py | ashwinjathar/Version10.x.x | a70bd7e0af8112c370dc6709e480ea60c95a0d56 | [
"MIT"
] | null | null | null | frappe/custom/doctype/customize_form/customize_form.py | ashwinjathar/Version10.x.x | a70bd7e0af8112c370dc6709e480ea60c95a0d56 | [
"MIT"
] | 9 | 2020-03-24T18:09:18.000Z | 2022-03-12T00:12:04.000Z | frappe/custom/doctype/customize_form/customize_form.py | proenterprise/frappe-10 | 5cd5417ac38ca7e0b152c1e6fa5d812e0763da0a | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Customize Form is a Single DocType used to mask the Property Setter
Thus providing a better UI from user perspective
"""
import frappe
import frappe.translate
from frappe im... | 32.677515 | 113 | 0.710276 |
from __future__ import unicode_literals
import frappe
import frappe.translate
from frappe import _
from frappe.utils import cint
from frappe.model.document import Document
from frappe.model import no_value_fields, core_doctypes_list
from frappe.core.doctype.doctype.doctype import validate_fields_for_doctype
doctype_p... | true | true |
1c05cc9a7b66c0c0b75ef479db11f562fe799de2 | 2,328 | py | Python | opt/resource/test_out.py | cosee-concourse/deployboard-resource | 632e7db12657f1b19821a0acc36919d3fb4133a8 | [
"MIT"
] | null | null | null | opt/resource/test_out.py | cosee-concourse/deployboard-resource | 632e7db12657f1b19821a0acc36919d3fb4133a8 | [
"MIT"
] | null | null | null | opt/resource/test_out.py | cosee-concourse/deployboard-resource | 632e7db12657f1b19821a0acc36919d3fb4133a8 | [
"MIT"
] | null | null | null | import unittest
import json
import out
from concourse_common import testutil
class TestOutput(unittest.TestCase):
def test_json_output_wrong_source(self):
testutil.put_stdin(json.dumps({"source": {"SLACK_BOT_TOKEN": "test"}, "params": {"version": "1.1.0",
... | 48.5 | 117 | 0.397337 | import unittest
import json
import out
from concourse_common import testutil
class TestOutput(unittest.TestCase):
def test_json_output_wrong_source(self):
testutil.put_stdin(json.dumps({"source": {"SLACK_BOT_TOKEN": "test"}, "params": {"version": "1.1.0",
... | true | true |
1c05ccab05facfaba3e959a11a0ade628238318f | 957 | py | Python | Analyitics/Analyize.py | YrrepNoj/GiftCardExchangeHelper | dbe75298d0a2c9fd0b137968e69feb100453cee9 | [
"MIT"
] | null | null | null | Analyitics/Analyize.py | YrrepNoj/GiftCardExchangeHelper | dbe75298d0a2c9fd0b137968e69feb100453cee9 | [
"MIT"
] | null | null | null | Analyitics/Analyize.py | YrrepNoj/GiftCardExchangeHelper | dbe75298d0a2c9fd0b137968e69feb100453cee9 | [
"MIT"
] | null | null | null | import praw
import datetime
import time
from datetime import datetime
from AccountInfo import *
processedList = []
## *************************** MAIN *************************** ##
redditClient = praw.Reddit(client_id=clientID,
client_secret=clientSecret,
password=redditPas... | 25.184211 | 79 | 0.624869 | import praw
import datetime
import time
from datetime import datetime
from AccountInfo import *
processedList = []
redditClient = praw.Reddit(client_id=clientID,
client_secret=clientSecret,
password=redditPassword,
user_agent='GFX Helper Script',
... | true | true |
1c05cd5c8454a1f20b443b88407d10b1c30d1eac | 1,224 | py | Python | Examples/delay/universaldelay.py | apohl79/AudioTK | 05ac241b0bc6a8f841d93257b4d81e5961b1f627 | [
"BSD-3-Clause"
] | 10 | 2018-05-17T15:29:05.000Z | 2021-12-19T22:26:08.000Z | Examples/delay/universaldelay.py | apohl79/AudioTK | 05ac241b0bc6a8f841d93257b4d81e5961b1f627 | [
"BSD-3-Clause"
] | null | null | null | Examples/delay/universaldelay.py | apohl79/AudioTK | 05ac241b0bc6a8f841d93257b4d81e5961b1f627 | [
"BSD-3-Clause"
] | 2 | 2020-04-21T13:43:57.000Z | 2020-04-28T19:10:14.000Z | #!/usr/bin/env python
from ATK.Core import DoubleInPointerFilter, DoubleOutPointerFilter
from ATK.Delay import DoubleUniversalFixedDelayLineFilter
import matplotlib.pyplot as plt
sample_rate = 96000
def filter(input, blend=0, feedback=0, feedforward=1):
import numpy as np
output = np.zeros(input.shape, dtype=np... | 29.142857 | 68 | 0.76634 |
from ATK.Core import DoubleInPointerFilter, DoubleOutPointerFilter
from ATK.Delay import DoubleUniversalFixedDelayLineFilter
import matplotlib.pyplot as plt
sample_rate = 96000
def filter(input, blend=0, feedback=0, feedforward=1):
import numpy as np
output = np.zeros(input.shape, dtype=np.float64)
infilter ... | true | true |
1c05ce63e3d5ccd55eb3e8ceacc5188596883152 | 3,542 | py | Python | bindings/python/ensmallen/datasets/string/sphingobacterialesbacterium4415.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-09-10T18:31:58.000Z | 2022-03-24T04:28:04.000Z | bindings/python/ensmallen/datasets/string/sphingobacterialesbacterium4415.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/sphingobacterialesbacterium4415.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Sphingobacteriales bacterium 44-15.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: prot... | 33.733333 | 223 | 0.682383 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def SphingobacterialesBacterium4415(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "g... | true | true |
1c05cfbddc732c48f27a361b5ff64bf88de9663f | 5,595 | py | Python | lib/mistletoe/test/test_html_renderer.py | aguai/docgen | 5147658e2eaae3c8232ae66edea5b90cd8933d94 | [
"MIT"
] | null | null | null | lib/mistletoe/test/test_html_renderer.py | aguai/docgen | 5147658e2eaae3c8232ae66edea5b90cd8933d94 | [
"MIT"
] | null | null | null | lib/mistletoe/test/test_html_renderer.py | aguai/docgen | 5147658e2eaae3c8232ae66edea5b90cd8933d94 | [
"MIT"
] | null | null | null | from unittest import TestCase, mock
from mistletoe.html_renderer import HTMLRenderer
class TestRenderer(TestCase):
def setUp(self):
self.renderer = HTMLRenderer()
self.renderer.render_inner = mock.Mock(return_value='inner')
self.renderer.__enter__()
self.addCleanup(self.renderer.__... | 38.321918 | 83 | 0.630206 | from unittest import TestCase, mock
from mistletoe.html_renderer import HTMLRenderer
class TestRenderer(TestCase):
def setUp(self):
self.renderer = HTMLRenderer()
self.renderer.render_inner = mock.Mock(return_value='inner')
self.renderer.__enter__()
self.addCleanup(self.renderer.__... | true | true |
1c05d0a4b9a1d6b0e900d7db6db98b41fd640cfd | 7,644 | py | Python | python/paddle/fluid/__init__.py | Jie-Fang/Paddle | 7a9bd0c5d8eff2f4fd6b58ee786c556a07aa23d6 | [
"Apache-2.0"
] | 1 | 2020-11-03T04:57:40.000Z | 2020-11-03T04:57:40.000Z | python/paddle/fluid/__init__.py | Jie-Fang/Paddle | 7a9bd0c5d8eff2f4fd6b58ee786c556a07aa23d6 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/__init__.py | Jie-Fang/Paddle | 7a9bd0c5d8eff2f4fd6b58ee786c556a07aa23d6 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. 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 by app... | 33.674009 | 96 | 0.702904 |
from __future__ import print_function
import os
import sys
core_suffix = 'so'
if os.name == 'nt':
core_suffix = 'pyd'
legacy_core = os.path.abspath(os.path.dirname(
__file__)) + os.sep + 'core.' + core_suffix
if os.path.exists(legacy_core):
sys.stderr.write('Deleting legacy file ' + legacy_core + '\n')
... | true | true |
1c05d238f8129b43c274a99ab1f40de08f36f119 | 1,153 | py | Python | safebay_final_web_app/safebay/__init__.py | rhurst11/SafeBayProject | 4620e66dc7ba784c5eb29040534995d9482e0362 | [
"MIT"
] | null | null | null | safebay_final_web_app/safebay/__init__.py | rhurst11/SafeBayProject | 4620e66dc7ba784c5eb29040534995d9482e0362 | [
"MIT"
] | null | null | null | safebay_final_web_app/safebay/__init__.py | rhurst11/SafeBayProject | 4620e66dc7ba784c5eb29040534995d9482e0362 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
# IMPORTS THAT MAY HELP
from tempfile import mkdtemp
from flask import Response
from flask_session import Session
app = Flask(__name__)
app.config['SECRET_KEY'] = '5791628bb0b13ce0c676... | 29.564103 | 77 | 0.775369 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_login import LoginManager
from tempfile import mkdtemp
from flask import Response
from flask_session import Session
app = Flask(__name__)
app.config['SECRET_KEY'] = '5791628bb0b13ce0c676dfde280ba245'
app.config... | true | true |
1c05d359513b3ea4b454574a1f105bb280c78686 | 1,104 | py | Python | 2009/scientific-computing/prax3/src/RLPrax2_1.py | rla/old-code | 06aa69c3adef8434992410687d466dc42779e57b | [
"Ruby",
"MIT"
] | 2 | 2015-11-08T10:01:47.000Z | 2020-03-10T00:00:58.000Z | 2009/scientific-computing/prax3/src/RLPrax2_1.py | rla/old-code | 06aa69c3adef8434992410687d466dc42779e57b | [
"Ruby",
"MIT"
] | null | null | null | 2009/scientific-computing/prax3/src/RLPrax2_1.py | rla/old-code | 06aa69c3adef8434992410687d466dc42779e57b | [
"Ruby",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Raivo Laanemets
# rlaanemt@ut.ee
import sys
from Taring import Taring
# Abiklass kahe täringuviske mängu simuleerimiseks.
class GameSimulator:
def __init__(self, viskeid):
self.viskeid = viskeid
# Jooksutab simulatsiooni teatud arv kordi.
# Tagastab float-arvu, ... | 25.090909 | 58 | 0.587862 |
import sys
from Taring import Taring
class GameSimulator:
def __init__(self, viskeid):
self.viskeid = viskeid
def simulate(self):
taring1 = Taring()
taring2 = Taring()
p = 0
for i in range(0, self.viskeid):
vise1 = taring1.viska()
... | false | true |
1c05d40f94ad18a234eaf1e124bf7eb5512f6785 | 268 | py | Python | 02.py | garg10may/Python-for-Beginners-Solve-50-Exercises-Live | 7390f13809a4083169a9a7b7c4c6bbebc05bad04 | [
"MIT"
] | 13 | 2015-12-12T07:01:03.000Z | 2021-12-27T06:20:56.000Z | 02.py | garg10may/Python-for-Beginners-Solve-50-Exercises-Live | 7390f13809a4083169a9a7b7c4c6bbebc05bad04 | [
"MIT"
] | null | null | null | 02.py | garg10may/Python-for-Beginners-Solve-50-Exercises-Live | 7390f13809a4083169a9a7b7c4c6bbebc05bad04 | [
"MIT"
] | 11 | 2015-12-05T13:12:34.000Z | 2021-12-27T03:40:38.000Z | '''
Define a function max_of_three() that takes three numbers as
arguments and returns the largest of them.
'''
def max_of_three(a,b,c):
if a>b and a>c:
print a
elif b>c:
print b
else:
print c
print max_of_three(0,15,2) | 19.142857 | 60 | 0.600746 | '''
Define a function max_of_three() that takes three numbers as
arguments and returns the largest of them.
'''
def max_of_three(a,b,c):
if a>b and a>c:
print a
elif b>c:
print b
else:
print c
print max_of_three(0,15,2) | false | true |
1c05d47d2ebbe61306527755435abfa6010439c9 | 36,647 | py | Python | tests/framework/context/test_context.py | PaulEmmanuelSotir/kedro | 0b0d095bfc11324dc5a0fcf6e8dec891426b3a01 | [
"Apache-2.0"
] | 2 | 2020-07-27T12:20:55.000Z | 2020-08-15T17:06:15.000Z | tests/framework/context/test_context.py | PaulEmmanuelSotir/kedro | 0b0d095bfc11324dc5a0fcf6e8dec891426b3a01 | [
"Apache-2.0"
] | null | null | null | tests/framework/context/test_context.py | PaulEmmanuelSotir/kedro | 0b0d095bfc11324dc5a0fcf6e8dec891426b3a01 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 38.213764 | 96 | 0.647229 |
import configparser
import json
import re
import sys
from pathlib import Path, PurePath, PurePosixPath, PureWindowsPath
from time import sleep
from typing import Any, Dict
import pandas as pd
import pytest
import yaml
from pandas.util.testing import assert_frame_equal
from kedro import __version__ as kedro_version
f... | true | true |
1c05d6037e74859327de0cc8c99d054eb60b497d | 11,091 | py | Python | ngspyeasy/ngspyeasy_play_run.py | olgamelnichuk/NGSPyEasy | b7e1036bd866d55f0cf94e5f2d7e572c2c8fc956 | [
"Apache-2.0"
] | 1 | 2015-10-19T12:44:50.000Z | 2015-10-19T12:44:50.000Z | ngspyeasy/ngspyeasy_play_run.py | olgamelnichuk/NGSPyEasy | b7e1036bd866d55f0cf94e5f2d7e572c2c8fc956 | [
"Apache-2.0"
] | null | null | null | ngspyeasy/ngspyeasy_play_run.py | olgamelnichuk/NGSPyEasy | b7e1036bd866d55f0cf94e5f2d7e572c2c8fc956 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
###
# Copyright 2015, EMBL-EBI
#
# 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 o... | 37.982877 | 120 | 0.647282 |
import argparse
import shutil
import sys
import tempfile
from ansible.module_utils import basic
import playbook_yaml
import os
import cmdargs
from logger import logger, init_play_run_logger
from ansible.playbook import PlayBook
from ansible import callbacks
from ansible import utils
import yaml
def main(argv):
... | false | true |
1c05d6e223330691552b59854bcdfb89593d0fe2 | 17,994 | py | Python | nio/rooms.py | phildenhoff/matrix-nio | 5642d5a980d87c363e3b8c55d82224a4a353f3d3 | [
"Apache-2.0"
] | 1 | 2021-06-28T02:45:13.000Z | 2021-06-28T02:45:13.000Z | nio/rooms.py | vSLG/matrix-nio | e408334c5db061e01fe89bcf57e34fa573cee573 | [
"Apache-2.0"
] | null | null | null | nio/rooms.py | vSLG/matrix-nio | e408334c5db061e01fe89bcf57e34fa573cee573 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2018 Damir Jelić <poljar@termina.org.uk>
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PR... | 34.339695 | 79 | 0.598033 |
from __future__ import unicode_literals
from builtins import super
from collections import defaultdict
from enum import Enum
from typing import (Any, DefaultDict, Dict, List, NamedTuple, Optional, Tuple,
Union)
from jsonschema.exceptions import SchemaError, ValidationError
from logbook import Lo... | true | true |
1c05d7dc34ab0c8417ba4270422f89b5e135c8ba | 444 | py | Python | SAC/agent.py | mahkons/RL-algorithms | bc5da6734263184e6229d34cd68f092feb94e9a3 | [
"MIT"
] | null | null | null | SAC/agent.py | mahkons/RL-algorithms | bc5da6734263184e6229d34cd68f092feb94e9a3 | [
"MIT"
] | null | null | null | SAC/agent.py | mahkons/RL-algorithms | bc5da6734263184e6229d34cd68f092feb94e9a3 | [
"MIT"
] | null | null | null | import random
import numpy as np
import os
import torch
class Agent:
def __init__(self):
self.model = torch.load(__file__[:-8] + "/agent.pkl", map_location="cpu")
def act(self, state):
with torch.no_grad():
state = torch.tensor(np.array([state]), dtype=torch.float)
... | 23.368421 | 81 | 0.592342 | import random
import numpy as np
import os
import torch
class Agent:
def __init__(self):
self.model = torch.load(__file__[:-8] + "/agent.pkl", map_location="cpu")
def act(self, state):
with torch.no_grad():
state = torch.tensor(np.array([state]), dtype=torch.float)
... | true | true |
1c05d7f60db1f6924b7f9dc98d495f85325a7646 | 1,910 | py | Python | lib/metrics/running_score.py | donnyyou/openseg.pytorch | ff55a5d975b7cd806e01ba539db9207d45b0e221 | [
"Apache-2.0"
] | 5 | 2020-04-17T01:56:52.000Z | 2021-03-04T11:15:09.000Z | lib/metrics/running_score.py | donnyyou/openseg.pytorch | ff55a5d975b7cd806e01ba539db9207d45b0e221 | [
"Apache-2.0"
] | null | null | null | lib/metrics/running_score.py | donnyyou/openseg.pytorch | ff55a5d975b7cd806e01ba539db9207d45b0e221 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Donny You(youansheng@gmail.com)
# Segmentation running score.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
class RunningScore(object):
def __init__(self, configer):
... | 31.311475 | 96 | 0.625131 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
class RunningScore(object):
def __init__(self, configer):
self.configer = configer
self.n_classes = self.configer.get('data', 'num_classes')
self.confusion_ma... | true | true |
1c05d841b67a207a840c7f5048390e2b6515f22d | 180 | py | Python | QRgenerator.py | pythonites/Every-Python-Code- | ebe6fe072a54f4fa066bbaba7c496d71d2bf4c82 | [
"MIT"
] | 4 | 2020-10-20T05:27:33.000Z | 2020-10-26T04:15:15.000Z | QRgenerator.py | pythonites/Every-Python-Code- | ebe6fe072a54f4fa066bbaba7c496d71d2bf4c82 | [
"MIT"
] | 7 | 2020-10-20T05:29:28.000Z | 2020-10-27T04:03:48.000Z | QRgenerator.py | pythonites/Every-Python-Code- | ebe6fe072a54f4fa066bbaba7c496d71d2bf4c82 | [
"MIT"
] | 6 | 2020-10-20T05:15:47.000Z | 2020-10-25T16:04:38.000Z | import pyqrcode
import png
from pyqrcode import QRCode
s = input("Enter string to make it QR: ")
url = pyqrcode.create(s)
url.png('/storage/emulated/0/myqr.png', scale = 10)
| 20 | 51 | 0.711111 | import pyqrcode
import png
from pyqrcode import QRCode
s = input("Enter string to make it QR: ")
url = pyqrcode.create(s)
url.png('/storage/emulated/0/myqr.png', scale = 10)
| true | true |
1c05d9068efcdc5651912cb30ca201ac010481b5 | 618 | py | Python | arm_controller/launch/arm_bringup.launch.py | AD-SDL/ot2_workcell | c994c5a5bd79a154e624f17bbde1a13a5461cc69 | [
"MIT"
] | 2 | 2022-02-09T19:18:58.000Z | 2022-02-09T19:18:59.000Z | arm_controller/launch/arm_bringup.launch.py | urd00m/ros2tests | c994c5a5bd79a154e624f17bbde1a13a5461cc69 | [
"MIT"
] | 1 | 2022-03-14T20:50:28.000Z | 2022-03-14T20:50:28.000Z | arm_controller/launch/arm_bringup.launch.py | urd00m/ros2tests | c994c5a5bd79a154e624f17bbde1a13a5461cc69 | [
"MIT"
] | null | null | null | from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
ld = LaunchDescription()
arm_manager = Node(
package="arm_controller",
executable="arm_manager",
output='screen',
parameters=[{"name": "army"}],
emulate_tty=True,... | 25.75 | 42 | 0.644013 | from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
ld = LaunchDescription()
arm_manager = Node(
package="arm_controller",
executable="arm_manager",
output='screen',
parameters=[{"name": "army"}],
emulate_tty=True,... | true | true |
1c05d9306744015c93d31d58ef0647f0f08d73bd | 977 | py | Python | libs/iou_loss.py | lizhaoliu-Lec/fcos | 6a5e25831c943f46286c3cff65500139886c921e | [
"MIT"
] | null | null | null | libs/iou_loss.py | lizhaoliu-Lec/fcos | 6a5e25831c943f46286c3cff65500139886c921e | [
"MIT"
] | null | null | null | libs/iou_loss.py | lizhaoliu-Lec/fcos | 6a5e25831c943f46286c3cff65500139886c921e | [
"MIT"
] | null | null | null | import torch
def bbox_overlaps_aligned(bboxes1, bboxes2, is_aligned=False):
'''
Param:
bboxes1: FloatTensor(n, 4) # 4: ymin, xmin, ymax, xmax
bboxes2: FloatTensor(n, 4)
Return:
FloatTensor(n)
'''
tl = torch.max(bboxes1[:, :2], bboxes2[:, :2]) # [rows, 2]
br = torch.min(bb... | 27.914286 | 85 | 0.538383 | import torch
def bbox_overlaps_aligned(bboxes1, bboxes2, is_aligned=False):
tl = torch.max(bboxes1[:, :2], bboxes2[:, :2]) br = torch.min(bboxes1[:, 2:], bboxes2[:, 2:]) hw = (br - tl + 1).clamp(min=0) overlap = hw[:, 0] * hw[:, 1]
area1 = (bboxes1[:, 2] - bboxes1[:, 0] + 1) * (bboxes1[:, 3] - ... | true | true |
1c05d9735e57462df173da7c934f1472c9fde457 | 11,787 | py | Python | third_party/WebKit/Tools/Scripts/webkitpy/style/filter.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-07-15T09:50:14.000Z | 2020-07-15T09:50:14.000Z | third_party/WebKit/Tools/Scripts/webkitpy/style/filter.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/WebKit/Tools/Scripts/webkitpy/style/filter.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions... | 42.247312 | 87 | 0.637397 |
def validate_filter_rules(filter_rules, all_categories):
for rule in filter_rules:
if not (rule.startswith('+') or rule.startswith('-')):
raise ValueError('Invalid filter rule "%s": every rule '
"must start with + or -." % rule)
for category in all_catego... | true | true |
1c05da6d1e6a8a68ce9ceb59e4be72e90376f59f | 89 | py | Python | pyqtgraph/flowchart/__init__.py | StSav012/pyqtgraph | 65e17c4e3707eb3bd4d91cdc13504d9b150f4360 | [
"MIT"
] | 1 | 2022-01-30T20:04:51.000Z | 2022-01-30T20:04:51.000Z | pyqtgraph/flowchart/__init__.py | StSav012/pyqtgraph | 65e17c4e3707eb3bd4d91cdc13504d9b150f4360 | [
"MIT"
] | null | null | null | pyqtgraph/flowchart/__init__.py | StSav012/pyqtgraph | 65e17c4e3707eb3bd4d91cdc13504d9b150f4360 | [
"MIT"
] | null | null | null | from .Flowchart import *
from .library import getNodeTree, getNodeType, registerNodeType
| 29.666667 | 63 | 0.831461 | from .Flowchart import *
from .library import getNodeTree, getNodeType, registerNodeType
| true | true |
1c05db2b4780db7ad444aa3c2ce4d76512191ad5 | 210 | py | Python | fuguangapi/fuguangapi/apps/coupon/apps.py | like-ycy/fuguang_api | d8080f9051718fa8ffa96d0037b62f5fe617d107 | [
"MIT"
] | null | null | null | fuguangapi/fuguangapi/apps/coupon/apps.py | like-ycy/fuguang_api | d8080f9051718fa8ffa96d0037b62f5fe617d107 | [
"MIT"
] | null | null | null | fuguangapi/fuguangapi/apps/coupon/apps.py | like-ycy/fuguang_api | d8080f9051718fa8ffa96d0037b62f5fe617d107 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CouponConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'coupon'
verbose_name = '优惠劵管理'
verbose_name_plural = verbose_name
| 23.333333 | 56 | 0.747619 | from django.apps import AppConfig
class CouponConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'coupon'
verbose_name = '优惠劵管理'
verbose_name_plural = verbose_name
| true | true |
1c05dbc152834bebcfca81d630014db8386d0b6d | 615 | py | Python | university_API/models.py | rajeshkumarkarra/django_REST-APIs | 78d571d4e21a7a1521339b3fcd82e2e22da1c52e | [
"Apache-2.0"
] | null | null | null | university_API/models.py | rajeshkumarkarra/django_REST-APIs | 78d571d4e21a7a1521339b3fcd82e2e22da1c52e | [
"Apache-2.0"
] | null | null | null | university_API/models.py | rajeshkumarkarra/django_REST-APIs | 78d571d4e21a7a1521339b3fcd82e2e22da1c52e | [
"Apache-2.0"
] | null | null | null | """
from django.db import models
class University(models.Model):
name = models.CharField(max_length=50)
class Meta:
verbose_name = "University"
verbose_name_plural = "Universities"
def __unicode__(self):
return self.name
class Student(models.Model):
first_name = models.CharFi... | 24.6 | 58 | 0.674797 | true | true | |
1c05dc9aa1b2014d32c958737ea90cbcc8241f41 | 1,076 | py | Python | kolab/ie/tmp.py | roy029/kolab | 10a3054da5e7c96c575de1336056eee65368c087 | [
"MIT"
] | null | null | null | kolab/ie/tmp.py | roy029/kolab | 10a3054da5e7c96c575de1336056eee65368c087 | [
"MIT"
] | 1 | 2021-11-14T05:38:27.000Z | 2021-11-14T05:38:27.000Z | kolab/ie/tmp.py | roy029/kolab | 10a3054da5e7c96c575de1336056eee65368c087 | [
"MIT"
] | 7 | 2020-11-02T13:05:44.000Z | 2022-01-09T11:06:04.000Z | templates = [
"本研究は、(.*)構築する",
"本研究は、(.*)解明する",
"本研究は、(.*)解明を目指す",
"本研究は、(.*)進める",
"本研究は、(.*)開発する",
"本研究は、(.*)目標とする",
"本研究は、(.*)目指す",
"本研究は、(.*)開発する",
"本研究は、(.*)目的とする",
"本研究は、(.*)解決する",
"本研究は、(.*)実現する",
"本研究は、(.*)探索する",
"本研究は、(.*)挑戦する",
"本研究は、(.*)解決を図る",
"本研究は... | 20.692308 | 22 | 0.387546 | templates = [
"本研究は、(.*)構築する",
"本研究は、(.*)解明する",
"本研究は、(.*)解明を目指す",
"本研究は、(.*)進める",
"本研究は、(.*)開発する",
"本研究は、(.*)目標とする",
"本研究は、(.*)目指す",
"本研究は、(.*)開発する",
"本研究は、(.*)目的とする",
"本研究は、(.*)解決する",
"本研究は、(.*)実現する",
"本研究は、(.*)探索する",
"本研究は、(.*)挑戦する",
"本研究は、(.*)解決を図る",
"本研究は... | true | true |
1c05dcdb7126c0b06a49e8684140f6f6ad379f60 | 2,635 | py | Python | examples/python/geometry/point_cloud_with_numpy.py | forrestjgq/Open3D | dcf94bd21943d943b54b402aed4e868da2687180 | [
"MIT"
] | 1,455 | 2021-07-27T19:44:50.000Z | 2022-03-31T19:39:21.000Z | examples/python/geometry/point_cloud_with_numpy.py | forrestjgq/Open3D | dcf94bd21943d943b54b402aed4e868da2687180 | [
"MIT"
] | 1,439 | 2021-07-27T16:02:52.000Z | 2022-03-31T22:29:05.000Z | examples/python/geometry/point_cloud_with_numpy.py | forrestjgq/Open3D | dcf94bd21943d943b54b402aed4e868da2687180 | [
"MIT"
] | 339 | 2021-07-28T03:07:28.000Z | 2022-03-31T13:38:00.000Z | # ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2018-2021 www.open3d.org
#
# Permission i... | 46.22807 | 79 | 0.639089 |
import open3d as o3d
import numpy as np
if __name__ == "__main__":
x = np.linspace(-3, 3, 201)
mesh_x, mesh_y = np.meshgrid(x, x)
z = np.sinc((np.power(mesh_x, 2) + np.power(mesh_y, 2)))
z_norm = (z - z.min()) / (z.max() - z.min())
xyz = np.zeros((np.size(mesh_x), 3))
xyz[:, 0] = np.reshap... | true | true |
1c05dcf0b5a23b60868b170b909ddf1aeda0669d | 777 | py | Python | ???? Minimum Absolute Difference Queries.py | MdAbedin/leetcode | e835f2e716ea5fe87f30b84801ede9bc023749e7 | [
"MIT"
] | 4 | 2020-09-11T02:36:11.000Z | 2021-09-29T20:47:11.000Z | ???? Minimum Absolute Difference Queries.py | MdAbedin/leetcode | e835f2e716ea5fe87f30b84801ede9bc023749e7 | [
"MIT"
] | 3 | 2020-09-10T03:51:42.000Z | 2021-09-25T01:41:57.000Z | ???? Minimum Absolute Difference Queries.py | MdAbedin/leetcode | e835f2e716ea5fe87f30b84801ede9bc023749e7 | [
"MIT"
] | 6 | 2020-09-10T03:46:15.000Z | 2021-09-25T01:24:48.000Z | class Solution:
def minDifference(self, nums: List[int], queries: List[List[int]]) -> List[int]:
locs = defaultdict(list)
for i in range(len(nums)):
locs[nums[i]].append(i)
ans = []
for l,r in queries:
last = None
cur... | 29.884615 | 84 | 0.410553 | class Solution:
def minDifference(self, nums: List[int], queries: List[List[int]]) -> List[int]:
locs = defaultdict(list)
for i in range(len(nums)):
locs[nums[i]].append(i)
ans = []
for l,r in queries:
last = None
cur... | true | true |
1c05dd484a45e8c8c86aed6cefbf51044b4be516 | 877 | py | Python | topCoder/srms/500s/srm590/div2/fox_and_gomoku.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-09-30T19:53:08.000Z | 2020-09-30T19:53:08.000Z | topCoder/srms/500s/srm590/div2/fox_and_gomoku.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | null | null | null | topCoder/srms/500s/srm590/div2/fox_and_gomoku.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-10-15T09:10:57.000Z | 2020-10-15T09:10:57.000Z | from itertools import groupby
class FoxAndGomoku:
def win(self, board):
def b(s):
return any(k == 'o' and len(list(g)) >= 5 for k, g in groupby(s))
for r in board:
if b(r):
return 'found'
for c in zip(*board):
if b(c):
re... | 28.290323 | 77 | 0.445838 | from itertools import groupby
class FoxAndGomoku:
def win(self, board):
def b(s):
return any(k == 'o' and len(list(g)) >= 5 for k, g in groupby(s))
for r in board:
if b(r):
return 'found'
for c in zip(*board):
if b(c):
re... | true | true |
1c05de47ec5d2584db51e7c1eab65192c888a72c | 6,047 | py | Python | app/code/schema_creation.py | tanviwagh/Movies_Analysis | 6ef9774988535031e8a63d890e47bf530a9bafec | [
"MIT"
] | null | null | null | app/code/schema_creation.py | tanviwagh/Movies_Analysis | 6ef9774988535031e8a63d890e47bf530a9bafec | [
"MIT"
] | 34 | 2022-01-23T11:59:15.000Z | 2022-03-29T12:02:53.000Z | app/code/schema_creation.py | tanviwagh/Movies_Analysis | 6ef9774988535031e8a63d890e47bf530a9bafec | [
"MIT"
] | 1 | 2022-03-18T15:52:23.000Z | 2022-03-18T15:52:23.000Z |
def process(spark, config):
db_name = config['athena']['db_name']
movie_tbl_name = config['athena']['movie_tbl_name']
movie_s3_loc = config['athena']['movie_s3_loc']
genre_tbl_name = config['athena']['genre_tbl_name']
genre_s3_loc = config['athena']['genre_s3_loc']
artist_tbl_name = config[... | 33.782123 | 79 | 0.673061 |
def process(spark, config):
db_name = config['athena']['db_name']
movie_tbl_name = config['athena']['movie_tbl_name']
movie_s3_loc = config['athena']['movie_s3_loc']
genre_tbl_name = config['athena']['genre_tbl_name']
genre_s3_loc = config['athena']['genre_s3_loc']
artist_tbl_name = config[... | true | true |
1c05decc84745cfb04fcc20317bf0aeccdeefda5 | 17,403 | py | Python | telepresence/proxy/deployment.py | alter3d/telepresence | 693b1a3c42e13cc9aae3b4380ba4f86e89877951 | [
"Apache-2.0"
] | null | null | null | telepresence/proxy/deployment.py | alter3d/telepresence | 693b1a3c42e13cc9aae3b4380ba4f86e89877951 | [
"Apache-2.0"
] | null | null | null | telepresence/proxy/deployment.py | alter3d/telepresence | 693b1a3c42e13cc9aae3b4380ba4f86e89877951 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Datawire. 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 by applicable law or agr... | 31.413357 | 115 | 0.612251 |
import json
import os
from copy import deepcopy
from subprocess import CalledProcessError
from typing import Dict, Optional, Tuple
from telepresence import (
TELEPRESENCE_REMOTE_IMAGE, TELEPRESENCE_REMOTE_IMAGE_OCP,
TELEPRESENCE_REMOTE_IMAGE_PRIV
)
from telepresence.cli import PortMapping
from telepresence.ru... | true | true |
1c05dfa7bb00f5d5a7ffd16deabb68c9a04584fc | 1,205 | py | Python | fhirclient/models/binary.py | zzhou41/client-py | cbfa8d7c7f1bad233b237b7c5582fc0577b21f70 | [
"Apache-2.0"
] | null | null | null | fhirclient/models/binary.py | zzhou41/client-py | cbfa8d7c7f1bad233b237b7c5582fc0577b21f70 | [
"Apache-2.0"
] | null | null | null | fhirclient/models/binary.py | zzhou41/client-py | cbfa8d7c7f1bad233b237b7c5582fc0577b21f70 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Binary) on 2019-07-29.
# 2019, SMART Health IT.
import sys
from dataclasses import dataclass
from typing import ClassVar, Optional, List
from .fhirabstractbase import empty_list
from .fhirr... | 34.428571 | 103 | 0.687967 | import sys
from dataclasses import dataclass
from typing import ClassVar, Optional, List
from .fhirabstractbase import empty_list
from .fhirreference import FHIRReference
from .resource import Resource
@dataclass
class Binary(Resource):
resource_type: ClassVar[str] = "Binary"
contentType: str = None
secu... | true | true |
1c05e0d8ec36242a782192d9b90bfe104143231a | 24,244 | py | Python | .ci/watchdog/Watchdog.py | evelynfay/ngraph-onnx | a5ba2745ee6151c98255bb736ef5f116ce0c1e3c | [
"Apache-2.0"
] | null | null | null | .ci/watchdog/Watchdog.py | evelynfay/ngraph-onnx | a5ba2745ee6151c98255bb736ef5f116ce0c1e3c | [
"Apache-2.0"
] | null | null | null | .ci/watchdog/Watchdog.py | evelynfay/ngraph-onnx | a5ba2745ee6151c98255bb736ef5f116ce0c1e3c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# INTEL CONFIDENTIAL
# Copyright 2018-2019 Intel Corporation All Rights Reserved.
# The source code contained or described herein and all documents related to the
# source code ("Material") are owned by Intel Corporation or its suppliers or
# licensors. Title to the Material remains with Intel Corpo... | 46.803089 | 118 | 0.63789 |
# No license under any patent, copyright, trade secret or other intellectual
# property right is granted to or conferred upon you by disclosure or delivery of
# the Materials, either expressly, by implication, inducement, estoppel or
# otherwise. Any license under such intellectual property rights must be express
# an... | true | true |
1c05e182390a5dfaf4055716f898ca5421531c8e | 2,392 | py | Python | plugins/digitalocean/komand_digitalocean/actions/create_snapshot_from_volume/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/digitalocean/komand_digitalocean/actions/create_snapshot_from_volume/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/digitalocean/komand_digitalocean/actions/create_snapshot_from_volume/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Creates a snapshot from a volume"
class Input:
SNAPSHOT_NAME = "snapshot_name"
VOLUME_ID = "volume_id"
class Output:
SNAPSHOT = "snapshot"
class CreateSnapshotFromVolumeInput(komand.Input):
... | 20.271186 | 60 | 0.4699 | import komand
import json
class Component:
DESCRIPTION = "Creates a snapshot from a volume"
class Input:
SNAPSHOT_NAME = "snapshot_name"
VOLUME_ID = "volume_id"
class Output:
SNAPSHOT = "snapshot"
class CreateSnapshotFromVolumeInput(komand.Input):
schema = json.loads("""
{
"type... | true | true |
1c05e1ad221a103aeec9617147545bd0cc8e63ed | 539 | py | Python | kampnote/config-dev.py | aiblabco/files | c8212a4ef54c9656587d94a080a60414a22afc05 | [
"Apache-2.0"
] | null | null | null | kampnote/config-dev.py | aiblabco/files | c8212a4ef54c9656587d94a080a60414a22afc05 | [
"Apache-2.0"
] | null | null | null | kampnote/config-dev.py | aiblabco/files | c8212a4ef54c9656587d94a080a60414a22afc05 | [
"Apache-2.0"
] | null | null | null | import os
c = get_config()
c.Spawner.cmd = "/home/kampnote/mambaforge/bin/jupyter-labhub"
c.Spawner.default_url = "/lab"
c.JupyterHub.spawner_class = "sudospawner.SudoSpawner"
c.JupyterHub.logo_file = "/home/kampnote/mambaforge/share/jupyterhub/static/images/kampnote.png"
c.JupyterHub.authenticator_class = 'kampauth'
... | 44.916667 | 96 | 0.786642 | import os
c = get_config()
c.Spawner.cmd = "/home/kampnote/mambaforge/bin/jupyter-labhub"
c.Spawner.default_url = "/lab"
c.JupyterHub.spawner_class = "sudospawner.SudoSpawner"
c.JupyterHub.logo_file = "/home/kampnote/mambaforge/share/jupyterhub/static/images/kampnote.png"
c.JupyterHub.authenticator_class = 'kampauth'
... | true | true |
1c05e22260656e417bfb4d7f7505a30d2193752a | 22,321 | py | Python | tensorflow/python/layers/base.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 9 | 2019-12-29T01:47:37.000Z | 2021-12-21T13:47:41.000Z | tensorflow/python/layers/base.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 1 | 2019-06-18T07:56:15.000Z | 2019-06-18T07:56:15.000Z | tensorflow/python/layers/base.py | PaulWang1905/tensorflow | ebf12d22b4801fb8dab5034cc94562bf7cc33fa0 | [
"Apache-2.0"
] | 2 | 2021-01-26T08:23:41.000Z | 2021-07-13T16:23:18.000Z | # Copyright 2015 The TensorFlow Authors. 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 by applica... | 38.22089 | 80 | 0.685946 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.keras import backend
from tensorflow.py... | true | true |
1c05e255b66dd8c750e9cef6d976e61fcb53d68c | 985 | py | Python | hris/apps/departments/views.py | Minedomain/hris_backend | 90aab497c076c2d4ce4e05a441db0ee7a175df57 | [
"MIT"
] | null | null | null | hris/apps/departments/views.py | Minedomain/hris_backend | 90aab497c076c2d4ce4e05a441db0ee7a175df57 | [
"MIT"
] | null | null | null | hris/apps/departments/views.py | Minedomain/hris_backend | 90aab497c076c2d4ce4e05a441db0ee7a175df57 | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from .models import Department
from .serializers import *
class DepartmentViewset(viewsets.ModelViewSet):
queryset = Department.objects.all().order_by('id')
serializer_class = DepartmentSerializer
permission_classes ... | 35.178571 | 68 | 0.707614 | from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from .models import Department
from .serializers import *
class DepartmentViewset(viewsets.ModelViewSet):
queryset = Department.objects.all().order_by('id')
serializer_class = DepartmentSerializer
permission_classes ... | true | true |
1c05e46e021c1fbc4c2c7b207dcece0548403564 | 951 | py | Python | SAAVpedia/db/__init__.py | saavpedia/python | 071f745dbe5dfa7a655cb08aa99886541b030daa | [
"Apache-2.0"
] | null | null | null | SAAVpedia/db/__init__.py | saavpedia/python | 071f745dbe5dfa7a655cb08aa99886541b030daa | [
"Apache-2.0"
] | null | null | null | SAAVpedia/db/__init__.py | saavpedia/python | 071f745dbe5dfa7a655cb08aa99886541b030daa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
################################################################################
# Copyright 2018 Young-Mook Kang <ymkang@thylove.org>
#
# 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 ... | 36.576923 | 80 | 0.64143 |
from ClassSAAVpediaInputParser import SAAVpediaInputParser
from ClassOnlineDB import OnlineDB
from ClassLocalDB import LocalDB
if __name__ == '__main__':
pass
| true | true |
1c05e5516a24360aea138362eb0af596688da81b | 1,023 | py | Python | rectangle_packing_solver/__init__.py | kotarot/rectangle-packing-solver | 6f11e2f1b8f8afb3fab0659b73a7a52f0636183f | [
"Apache-2.0"
] | 14 | 2021-05-08T10:56:47.000Z | 2022-03-18T10:16:53.000Z | rectangle_packing_solver/__init__.py | abcdxyz8/rectangle-packing-solver | 6f11e2f1b8f8afb3fab0659b73a7a52f0636183f | [
"Apache-2.0"
] | 28 | 2021-05-08T15:55:32.000Z | 2022-03-12T12:02:33.000Z | rectangle_packing_solver/__init__.py | abcdxyz8/rectangle-packing-solver | 6f11e2f1b8f8afb3fab0659b73a7a52f0636183f | [
"Apache-2.0"
] | 6 | 2021-05-23T13:04:13.000Z | 2022-03-12T13:28:26.000Z | # Copyright 2021 Kotaro Terada
#
# 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... | 26.230769 | 74 | 0.747801 |
from .__version__ import __version__, __version_info__
from .floorplan import Floorplan
from .problem import Problem
from .sequence_pair import SequencePair
from .solution import Solution
from .solver import Solver
from .visualizer import Visualizer
__all__ = [
"__version__",
"__version_info__",
"Floor... | true | true |
1c05e6b53af9756ef2e47ab2279d080581e87865 | 14,308 | py | Python | test_libs/pyspec/tests/test_sanity.py | ssteiger/eth2.0-specs | 23b1cb225d4aab476bbeba06ab1d17755ccfd104 | [
"CC0-1.0"
] | 1 | 2021-05-22T16:06:27.000Z | 2021-05-22T16:06:27.000Z | test_libs/pyspec/tests/test_sanity.py | ssteiger/eth2.0-specs | 23b1cb225d4aab476bbeba06ab1d17755ccfd104 | [
"CC0-1.0"
] | null | null | null | test_libs/pyspec/tests/test_sanity.py | ssteiger/eth2.0-specs | 23b1cb225d4aab476bbeba06ab1d17755ccfd104 | [
"CC0-1.0"
] | null | null | null | from copy import deepcopy
import pytest
from py_ecc import bls
import eth2spec.phase0.spec as spec
from eth2spec.utils.minimal_ssz import signing_root
from eth2spec.phase0.spec import (
# constants
ZERO_HASH,
SLOTS_PER_HISTORICAL_ROOT,
# SSZ
Deposit,
Transfer,
VoluntaryExit,
# functio... | 32.741419 | 104 | 0.753844 | from copy import deepcopy
import pytest
from py_ecc import bls
import eth2spec.phase0.spec as spec
from eth2spec.utils.minimal_ssz import signing_root
from eth2spec.phase0.spec import (
ZERO_HASH,
SLOTS_PER_HISTORICAL_ROOT,
Deposit,
Transfer,
VoluntaryExit,
get_active_validator_in... | true | true |
1c05e71422d56a4ac2694b9d1b341ba63d585bf5 | 12,054 | py | Python | python/taichi/lang/ops.py | samuela/taichi | e2b5c5b1a7b9d11ad1fed081dcc6443a4f1bb3a2 | [
"MIT"
] | null | null | null | python/taichi/lang/ops.py | samuela/taichi | e2b5c5b1a7b9d11ad1fed081dcc6443a4f1bb3a2 | [
"MIT"
] | null | null | null | python/taichi/lang/ops.py | samuela/taichi | e2b5c5b1a7b9d11ad1fed081dcc6443a4f1bb3a2 | [
"MIT"
] | null | null | null | from .expr import *
from .util import *
from .impl import expr_init
from .exception import TaichiSyntaxError
from .util import taichi_lang_core as ti_core
import operator as ops
import numbers
import functools
import math
unary_ops = []
def stack_info():
s = traceback.extract_stack()[3:-1]
for i, l in enumer... | 22.076923 | 79 | 0.643687 | from .expr import *
from .util import *
from .impl import expr_init
from .exception import TaichiSyntaxError
from .util import taichi_lang_core as ti_core
import operator as ops
import numbers
import functools
import math
unary_ops = []
def stack_info():
s = traceback.extract_stack()[3:-1]
for i, l in enumer... | true | true |
1c05e71e54bc8f26170d34bb09d3fe0316a572f9 | 2,697 | py | Python | py/legacyanalysis/galnorm.py | manera/legacypipe | 64dfe164fe1def50f5ad53784edd9a63321b0d45 | [
"BSD-3-Clause"
] | 32 | 2015-08-25T00:25:23.000Z | 2022-03-04T06:35:54.000Z | py/legacyanalysis/galnorm.py | manera/legacypipe | 64dfe164fe1def50f5ad53784edd9a63321b0d45 | [
"BSD-3-Clause"
] | 644 | 2015-07-08T16:26:28.000Z | 2022-03-30T19:09:10.000Z | py/legacyanalysis/galnorm.py | manera/legacypipe | 64dfe164fe1def50f5ad53784edd9a63321b0d45 | [
"BSD-3-Clause"
] | 22 | 2015-08-24T18:27:36.000Z | 2021-12-04T03:10:42.000Z | from legacypipe.survey import LegacySurveyData, wcs_for_brick, SimpleGalaxy
from tractor import NanoMaggies
import numpy as np
import pylab as plt
survey = LegacySurveyData()
brick = survey.get_brick_by_name('0006m062')
print('Brick', brick)
targetwcs = wcs_for_brick(brick)
H,W = targetwcs.shape
targetrd = np.array([... | 24.297297 | 75 | 0.658139 | from legacypipe.survey import LegacySurveyData, wcs_for_brick, SimpleGalaxy
from tractor import NanoMaggies
import numpy as np
import pylab as plt
survey = LegacySurveyData()
brick = survey.get_brick_by_name('0006m062')
print('Brick', brick)
targetwcs = wcs_for_brick(brick)
H,W = targetwcs.shape
targetrd = np.array([... | true | true |
1c05e72e46517573adf4683e4d56cc865328b51c | 2,170 | py | Python | src/oci/ocvp/models/supported_sku_summary_collection.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/ocvp/models/supported_sku_summary_collection.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/ocvp/models/supported_sku_summary_collection.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 30.56338 | 245 | 0.663594 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class SupportedSkuSummaryCollection(object):
def __init__(self, **kwargs):
self.swagger_types = {
'items': 'lis... | true | true |
1c05e7980ab1bc5e797567c253c9443a3a4886f4 | 23,665 | py | Python | instabot/bot/bot.py | taaaaho/instabot | 473576701d90a843694f352104b7b35b880d9bf1 | [
"Apache-2.0"
] | null | null | null | instabot/bot/bot.py | taaaaho/instabot | 473576701d90a843694f352104b7b35b880d9bf1 | [
"Apache-2.0"
] | null | null | null | instabot/bot/bot.py | taaaaho/instabot | 473576701d90a843694f352104b7b35b880d9bf1 | [
"Apache-2.0"
] | null | null | null | import atexit
import datetime
import random
import signal
import time
from .. import utils
from ..api import API
from .bot_archive import archive, archive_medias, unarchive_medias
from .bot_block import block, block_bots, block_users, unblock, unblock_users
from .bot_checkpoint import load_checkpoint, save_checkpoint
... | 36.407692 | 128 | 0.644243 | import atexit
import datetime
import random
import signal
import time
from .. import utils
from ..api import API
from .bot_archive import archive, archive_medias, unarchive_medias
from .bot_block import block, block_bots, block_users, unblock, unblock_users
from .bot_checkpoint import load_checkpoint, save_checkpoint
... | true | true |
1c05e843f9824bc96ec4f9f9a8982e9ff2ea9b06 | 1,393 | py | Python | src/download.py | pankon/torah_play | de9a3746c4bf720680ba50d826ad95a7c247ed4e | [
"MIT"
] | null | null | null | src/download.py | pankon/torah_play | de9a3746c4bf720680ba50d826ad95a7c247ed4e | [
"MIT"
] | null | null | null | src/download.py | pankon/torah_play | de9a3746c4bf720680ba50d826ad95a7c247ed4e | [
"MIT"
] | null | null | null | import os
import requests
from src.letter import Letter
def parse(raw: requests.Response):
lines = raw.text.split("\n")
idx = 0
length = len(lines)
out = []
print(lines[idx])
# skip preamble
while idx < length and not lines[idx].startswith("Chapter"):
idx += 1
idx += 2
... | 23.216667 | 147 | 0.613065 | import os
import requests
from src.letter import Letter
def parse(raw: requests.Response):
lines = raw.text.split("\n")
idx = 0
length = len(lines)
out = []
print(lines[idx])
while idx < length and not lines[idx].startswith("Chapter"):
idx += 1
idx += 2
while idx < le... | true | true |
1c05e94eafae39620996c7294e0cf010e9cd89a1 | 4,605 | py | Python | Hammer.py | Alex1127/mbf | 46c9ed882074e762a70f9e4ec5efc9630d9a3788 | [
"Apache-2.0"
] | null | null | null | Hammer.py | Alex1127/mbf | 46c9ed882074e762a70f9e4ec5efc9630d9a3788 | [
"Apache-2.0"
] | null | null | null | Hammer.py | Alex1127/mbf | 46c9ed882074e762a70f9e4ec5efc9630d9a3788 | [
"Apache-2.0"
] | null | null | null |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# python 3.3.2+ Hammer Dos Script v.1
# by Can Yalçın
# only for legal purpose
from queue import Queue
from optparse import OptionParser
import time,sys,socket,threading,logging,urllib.request,random
def user_agent():
global uagent
uagent=[]
uagent.append("Mozilla/5.0 ... | 27.909091 | 141 | 0.666884 |
from queue import Queue
from optparse import OptionParser
import time,sys,socket,threading,logging,urllib.request,random
def user_agent():
global uagent
uagent=[]
uagent.append("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0) Opera 12.14")
uagent.append("Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/... | true | true |
1c05eb1c1d770c3744aa979c8da9cee8f6664bc7 | 1,524 | py | Python | unzip_pwd.py | Tjccs/Python_exploits | be13bd79537ba44386481ff4a3d56a80dc09b169 | [
"MIT"
] | null | null | null | unzip_pwd.py | Tjccs/Python_exploits | be13bd79537ba44386481ff4a3d56a80dc09b169 | [
"MIT"
] | null | null | null | unzip_pwd.py | Tjccs/Python_exploits | be13bd79537ba44386481ff4a3d56a80dc09b169 | [
"MIT"
] | null | null | null | import zipfile
import sys
import argparse
import itertools
import string
from threading import Thread
def extracZip(zfile, dictionary):
with open(dictionary, 'r') as f:
for password in f:
password = password.rstrip().encode('utf-8')
try:
zipfile.ZipFile(zfile).extra... | 27.709091 | 84 | 0.610892 | import zipfile
import sys
import argparse
import itertools
import string
from threading import Thread
def extracZip(zfile, dictionary):
with open(dictionary, 'r') as f:
for password in f:
password = password.rstrip().encode('utf-8')
try:
zipfile.ZipFile(zfile).extra... | true | true |
1c05eb2cd8d4d7a5899b2b9b1e3c365dafcf1570 | 8,421 | py | Python | data/data_manager.py | mayankgolhar/self-supervised-da | 8402349f495887c97a5f91499d7c474830545530 | [
"MIT"
] | null | null | null | data/data_manager.py | mayankgolhar/self-supervised-da | 8402349f495887c97a5f91499d7c474830545530 | [
"MIT"
] | null | null | null | data/data_manager.py | mayankgolhar/self-supervised-da | 8402349f495887c97a5f91499d7c474830545530 | [
"MIT"
] | null | null | null | from torch.utils.data import Dataset
from torchvision import transforms
import os
import numpy as np
from PIL import Image
import torch
import random
import re
IMG_EXTENSIONS = [
'.jpg', '.JPG', '.jpeg', '.JPEG',
'.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', '.tiff'
]
class Data_Manager(Dataset):
def __... | 42.530303 | 139 | 0.502434 | from torch.utils.data import Dataset
from torchvision import transforms
import os
import numpy as np
from PIL import Image
import torch
import random
import re
IMG_EXTENSIONS = [
'.jpg', '.JPG', '.jpeg', '.JPEG',
'.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', '.tiff'
]
class Data_Manager(Dataset):
def __... | true | true |
1c05eb50877b1de5f7a60d2407e9c819f24db084 | 1,396 | py | Python | tests/metaclass_type_test.py | Carreau/pyupgrade | f766c29ec4bb6cf2674b81959871e59d5400380a | [
"MIT"
] | 1 | 2020-09-04T17:12:11.000Z | 2020-09-04T17:12:11.000Z | tests/metaclass_type_test.py | Carreau/pyupgrade | f766c29ec4bb6cf2674b81959871e59d5400380a | [
"MIT"
] | 5 | 2020-09-04T17:12:24.000Z | 2020-11-27T01:54:29.000Z | tests/metaclass_type_test.py | Smirenost/pyupgrade | f766c29ec4bb6cf2674b81959871e59d5400380a | [
"MIT"
] | null | null | null | import pytest
from pyupgrade import _fix_py3_plus
@pytest.mark.parametrize(
's',
(
pytest.param(
'x = type\n'
'__metaclass__ = x\n',
id='not rewriting "type" rename',
),
pytest.param(
'def foo():\n'
' __metaclass__ = type\... | 24.068966 | 63 | 0.489971 | import pytest
from pyupgrade import _fix_py3_plus
@pytest.mark.parametrize(
's',
(
pytest.param(
'x = type\n'
'__metaclass__ = x\n',
id='not rewriting "type" rename',
),
pytest.param(
'def foo():\n'
' __metaclass__ = type\... | true | true |
1c05eb68fd905070e7348cf99d0a8a96003f8928 | 7,424 | py | Python | pgoapi/protos/pogoprotos/enums/form_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 2 | 2018-02-09T07:35:25.000Z | 2019-05-22T17:51:07.000Z | pgoapi/protos/pogoprotos/enums/form_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | null | null | null | pgoapi/protos/pogoprotos/enums/form_pb2.py | linherest/pgoapi | e3bdce71b06c099663e9796c8df166883059edd9 | [
"MIT"
] | 15 | 2017-02-24T01:30:23.000Z | 2021-06-27T08:46:43.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/enums/form.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import... | 31.862661 | 1,279 | 0.69868 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf i... | true | true |
1c05eca856e62fbc35d1862ea5a02411d6b2ffe5 | 452 | py | Python | leetcode/problems/offer/offer 47. 礼物的最大价值.py | songhn233/Algorithm-Packages | 56d6f3c2467c175ab8a19b82bdfb25fc881e2206 | [
"CC0-1.0"
] | 1 | 2020-08-10T21:40:21.000Z | 2020-08-10T21:40:21.000Z | leetcode/problems/offer/offer 47. 礼物的最大价值.py | songhn233/Algorithm-Packages | 56d6f3c2467c175ab8a19b82bdfb25fc881e2206 | [
"CC0-1.0"
] | null | null | null | leetcode/problems/offer/offer 47. 礼物的最大价值.py | songhn233/Algorithm-Packages | 56d6f3c2467c175ab8a19b82bdfb25fc881e2206 | [
"CC0-1.0"
] | null | null | null | class Solution:
def maxValue(self, grid: List[List[int]]) -> int:
f = [[0] * len(grid[0]) for i in range(len(grid))]
f[0][0] = grid[0][0]
for i in range(len(grid)):
for j in range(len(grid[0])):
if i - 1 >= 0:
f[i][j] = max(f[i][j], f[i-1][j]+g... | 37.666667 | 64 | 0.391593 | class Solution:
def maxValue(self, grid: List[List[int]]) -> int:
f = [[0] * len(grid[0]) for i in range(len(grid))]
f[0][0] = grid[0][0]
for i in range(len(grid)):
for j in range(len(grid[0])):
if i - 1 >= 0:
f[i][j] = max(f[i][j], f[i-1][j]+g... | true | true |
1c05efd5fe40ea00a635d04686c4b71c6d7dab5e | 10,711 | py | Python | google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/completers.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/completers.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | 4 | 2020-07-21T12:51:46.000Z | 2022-01-22T10:29:25.000Z | google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/completers.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | 1 | 2020-07-25T18:17:57.000Z | 2020-07-25T18:17:57.000Z | # -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. 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 requir... | 29.506887 | 97 | 0.723462 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import os
from googlecloudsdk.command_lib.resource_manager import completers as resource_manager_completers
from googlecloudsdk.command_lib.util import completers
from googlecloudsdk.command_lib.util impor... | true | true |
1c05efe3d07caa337e3ecf7330535b949ae6acd0 | 2,281 | py | Python | speech_recognition_system/plot_and_animation.py | RonaldsonBellande/ML_robot_command_recognition | 345ab7b07a02f09e0f2be470db18a0ff888f939b | [
"Apache-2.0"
] | null | null | null | speech_recognition_system/plot_and_animation.py | RonaldsonBellande/ML_robot_command_recognition | 345ab7b07a02f09e0f2be470db18a0ff888f939b | [
"Apache-2.0"
] | null | null | null | speech_recognition_system/plot_and_animation.py | RonaldsonBellande/ML_robot_command_recognition | 345ab7b07a02f09e0f2be470db18a0ff888f939b | [
"Apache-2.0"
] | null | null | null | from header_imports import *
class plot_graphs(object):
def __init__(self):
self.true_path = self.path + "Testing/"
self.number_images_to_plot = 1
def plot_episode_time_step(self, data, type_graph):
fig = plt.figure()
axis = fig.add_subplot(111)
color_graph = "blue"... | 36.206349 | 158 | 0.619904 | from header_imports import *
class plot_graphs(object):
def __init__(self):
self.true_path = self.path + "Testing/"
self.number_images_to_plot = 1
def plot_episode_time_step(self, data, type_graph):
fig = plt.figure()
axis = fig.add_subplot(111)
color_graph = "blue"... | true | true |
1c05f0f2b0012e1bf21799feed9b1cff8d419d38 | 16,068 | py | Python | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py | sacheu/azure-sdk-for-python | 8ab8d653458b04f9251e62072bf5ac73b42bfd5f | [
"MIT"
] | 1 | 2021-12-07T13:43:54.000Z | 2021-12-07T13:43:54.000Z | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py | RGKarthik/azure-sdk-for-python | 7927f8468808a6938972d32bad69448c98297c03 | [
"MIT"
] | 1 | 2019-10-14T19:43:52.000Z | 2019-10-14T19:43:52.000Z | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py | sacheu/azure-sdk-for-python | 8ab8d653458b04f9251e62072bf5ac73b42bfd5f | [
"MIT"
] | null | null | null | # 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 may ... | 48.690909 | 224 | 0.666293 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
1c05f118e331383984ba2056a11e725bae5ac210 | 9,679 | py | Python | txdbus/protocol.py | cocagne/txdbus | 58f1dabf75f2a3aac29b2c6aa67941347e98759f | [
"MIT"
] | 43 | 2015-02-04T09:25:05.000Z | 2021-04-23T02:38:48.000Z | txdbus/protocol.py | cocagne/txdbus | 58f1dabf75f2a3aac29b2c6aa67941347e98759f | [
"MIT"
] | 61 | 2015-02-21T23:37:20.000Z | 2020-10-13T14:38:40.000Z | txdbus/protocol.py | cocagne/txdbus | 58f1dabf75f2a3aac29b2c6aa67941347e98759f | [
"MIT"
] | 36 | 2015-01-14T10:13:59.000Z | 2020-10-12T18:27:06.000Z | """
This module implements the wire-level DBus protocol.
@author: Tom Cocagne
"""
import os.path
import struct
from twisted.internet import interfaces, protocol
from twisted.python import log
from zope.interface import implementer, Interface
from txdbus import error, message
_is_linux = False
if os.path.exists('/p... | 33.842657 | 79 | 0.569377 | import os.path
import struct
from twisted.internet import interfaces, protocol
from twisted.python import log
from zope.interface import implementer, Interface
from txdbus import error, message
_is_linux = False
if os.path.exists('/proc/version'):
with open('/proc/version') as f:
if f.read().startswith(... | true | true |
1c05f3da61bd90d424924acc4407634f8437985f | 1,651 | py | Python | test/test_standalone_module_with_issues.py | rbclark/camel-snake-pep8 | 0c1814e74732d0ecf30d037313c189afb430c3d6 | [
"MIT"
] | null | null | null | test/test_standalone_module_with_issues.py | rbclark/camel-snake-pep8 | 0c1814e74732d0ecf30d037313c189afb430c3d6 | [
"MIT"
] | null | null | null | test/test_standalone_module_with_issues.py | rbclark/camel-snake-pep8 | 0c1814e74732d0ecf30d037313c189afb430c3d6 | [
"MIT"
] | null | null | null |
from __future__ import print_function, division, absolute_import
#
# Test collisions due to Rope renaming.
#
def camelFunction(camelArg1, camelArg2, camelArg3, camelArg4, camelArg5):
"""Warning on this is correct, gives error."""
camel_arg4 = 333
class snake_class(object):
camelArg5 = camelArg3
... | 23.927536 | 87 | 0.696548 |
from __future__ import print_function, division, absolute_import
def camelFunction(camelArg1, camelArg2, camelArg3, camelArg4, camelArg5):
camel_arg4 = 333
class snake_class(object):
camelArg5 = camelArg3
snake_class.camelArg1 = camelArg1
snake_class.camelArg3 = snake_class.camelArg1
snak... | true | true |
1c05f4fe4e85cfc0322d4d164a13512070c4be70 | 1,291 | py | Python | dynastes/util/cache_context.py | dynastes-team/dynastes | 931b6d9ac83862eb39c2f5144c95b952e9efcd8e | [
"MIT"
] | 7 | 2020-01-18T14:28:04.000Z | 2021-11-10T16:46:34.000Z | dynastes/util/cache_context.py | veqtor/dynastes | 931b6d9ac83862eb39c2f5144c95b952e9efcd8e | [
"MIT"
] | null | null | null | dynastes/util/cache_context.py | veqtor/dynastes | 931b6d9ac83862eb39c2f5144c95b952e9efcd8e | [
"MIT"
] | null | null | null | class CacheContext:
def __init__(self):
self.context_tree = {}
self.current_node = self.context_tree
self.parent_stack = [self.current_node]
def __enter__(self):
cache_context = self
cache = self.current_node
return cache_context
def __exit__(self, type, va... | 28.688889 | 78 | 0.627421 | class CacheContext:
def __init__(self):
self.context_tree = {}
self.current_node = self.context_tree
self.parent_stack = [self.current_node]
def __enter__(self):
cache_context = self
cache = self.current_node
return cache_context
def __exit__(self, type, va... | true | true |
1c05f5b0c3600353c800fccca57ac7b9b63df556 | 4,207 | py | Python | test/ratmath/test_root_chaser.py | wavestate/wavestate-iirrational | 01d6dba8b2131fa2a099a74f17e6540f30cee606 | [
"Apache-2.0"
] | null | null | null | test/ratmath/test_root_chaser.py | wavestate/wavestate-iirrational | 01d6dba8b2131fa2a099a74f17e6540f30cee606 | [
"Apache-2.0"
] | null | null | null | test/ratmath/test_root_chaser.py | wavestate/wavestate-iirrational | 01d6dba8b2131fa2a099a74f17e6540f30cee606 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
"""
from __future__ import division, print_function, unicode_literals
import pytest
import numpy as np
from wavestate.iirrational.representations.polynomials import chebychev
from numpy.polynomial import chebyshev
chebroots = chebyshev.chebroots
chebfromroots = chebyshev.chebfromroots
che... | 26.626582 | 77 | 0.462562 | from __future__ import division, print_function, unicode_literals
import pytest
import numpy as np
from wavestate.iirrational.representations.polynomials import chebychev
from numpy.polynomial import chebyshev
chebroots = chebyshev.chebroots
chebfromroots = chebyshev.chebfromroots
chebder = chebyshev.chebder
chebadd... | true | true |
1c05f60c79c1b76fb99880809fca9f49956d436b | 15,333 | py | Python | statsmodels/tools/eval_measures.py | peterprescott/statsmodels | 7c4a71e8d16618315b7370c88212aa2a4f358270 | [
"BSD-3-Clause"
] | null | null | null | statsmodels/tools/eval_measures.py | peterprescott/statsmodels | 7c4a71e8d16618315b7370c88212aa2a4f358270 | [
"BSD-3-Clause"
] | null | null | null | statsmodels/tools/eval_measures.py | peterprescott/statsmodels | 7c4a71e8d16618315b7370c88212aa2a4f358270 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""some measures for evaluation of prediction, tests and model selection
Created on Tue Nov 08 15:23:20 2011
Updated on Wed Jun 03 10:42:20 2020
Authors: Josef Perktold & Peter Prescott
License: BSD-3
"""
import numpy as np
from statsmodels.tools.validation import array_like
def mse(x1, x2... | 25.944162 | 86 | 0.629035 | import numpy as np
from statsmodels.tools.validation import array_like
def mse(x1, x2, axis=0):
x1 = np.asanyarray(x1)
x2 = np.asanyarray(x2)
return np.mean((x1-x2)**2, axis=axis)
def rmse(x1, x2, axis=0):
x1 = np.asanyarray(x1)
x2 = np.asanyarray(x2)
return np.sqrt(mse(x1, x2, axis=axis))
... | true | true |
1c05f6b184db49e231e9471dbc8627d73342400d | 226 | py | Python | day1/part1.py | xfenix/adventofcode2018 | acb33426d26bfc244f9beb8aa6bee1e90532da90 | [
"MIT"
] | 1 | 2018-12-14T00:44:36.000Z | 2018-12-14T00:44:36.000Z | day1/part1.py | xfenix/adventofcode2018 | acb33426d26bfc244f9beb8aa6bee1e90532da90 | [
"MIT"
] | null | null | null | day1/part1.py | xfenix/adventofcode2018 | acb33426d26bfc244f9beb8aa6bee1e90532da90 | [
"MIT"
] | null | null | null | # https://adventofcode.com/2018/day/1
result = 0
freq_list = [result, ]
with open('./data.txt', 'r') as advfile:
data = advfile.read().strip().split("\n")
for item in data:
result += eval(item)
print(result)
| 20.545455 | 45 | 0.615044 | result = 0
freq_list = [result, ]
with open('./data.txt', 'r') as advfile:
data = advfile.read().strip().split("\n")
for item in data:
result += eval(item)
print(result)
| true | true |
1c05f70bb70cd5f595e3ff6e11fd4736e8a1e393 | 7,569 | py | Python | venv/lib/python3.6/site-packages/ZConfig/components/logger/handlers.py | chrisbsd/vulidityevm | 7caac3bb56866114188f3f21243dca8c949a9a1a | [
"MIT"
] | 2 | 2020-05-16T08:38:34.000Z | 2020-10-01T01:32:57.000Z | venv/lib/python3.6/site-packages/ZConfig/components/logger/handlers.py | chrisbsd/vulidityevm | 7caac3bb56866114188f3f21243dca8c949a9a1a | [
"MIT"
] | 1 | 2021-03-25T21:51:01.000Z | 2021-03-25T21:51:01.000Z | venv/lib/python3.6/site-packages/ZConfig/components/logger/handlers.py | chrisbsd/vulidityevm | 7caac3bb56866114188f3f21243dca8c949a9a1a | [
"MIT"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 33.197368 | 79 | 0.589113 |
from abc import abstractmethod
import sys
from ZConfig._compat import urlparse
from ZConfig.components.logger.factory import Factory
_log_format_variables = {
'name': '',
'levelno': '3',
'levelname': 'DEBUG',
'pathname': 'apath',
'filename': 'afile',
'module': 'amodule',
'lineno': 1,
... | true | true |
1c05f77a78f85254aa323e7c0b1d3f976caf3762 | 1,344 | py | Python | tests/metrics/process/test_change_set.py | avandeursen/pydriller | 5593cf5ad8cf9ecc3a42505048bc4389055d844c | [
"Apache-2.0"
] | 3 | 2020-08-20T10:27:13.000Z | 2021-11-02T20:28:16.000Z | tests/metrics/process/test_change_set.py | avandeursen/pydriller | 5593cf5ad8cf9ecc3a42505048bc4389055d844c | [
"Apache-2.0"
] | null | null | null | tests/metrics/process/test_change_set.py | avandeursen/pydriller | 5593cf5ad8cf9ecc3a42505048bc4389055d844c | [
"Apache-2.0"
] | null | null | null | import pytest
from datetime import datetime
from pydriller.metrics.process.change_set import ChangeSet
TEST_COMMIT_DATA = [
('test-repos/pydriller', 'ab36bf45859a210b0eae14e17683f31d19eea041', '71e053f61fc5d31b3e31eccd9c79df27c31279bf', 13, 8)
]
@pytest.mark.parametrize('path_to_repo, from_commit, to_commit, expe... | 35.368421 | 123 | 0.706845 | import pytest
from datetime import datetime
from pydriller.metrics.process.change_set import ChangeSet
TEST_COMMIT_DATA = [
('test-repos/pydriller', 'ab36bf45859a210b0eae14e17683f31d19eea041', '71e053f61fc5d31b3e31eccd9c79df27c31279bf', 13, 8)
]
@pytest.mark.parametrize('path_to_repo, from_commit, to_commit, expe... | true | true |
1c05f781c7ac0a5aaa796ebceefe9df0b4c5cba2 | 3,961 | py | Python | conversationinsights-mynlu/mynlu/registry.py | osswangxining/iot-app-enabler-conversation | 7c40a89072b1730869260320d77aa9856412424a | [
"Apache-2.0"
] | 4 | 2017-10-19T05:11:52.000Z | 2018-06-26T02:54:55.000Z | mynlu/registry.py | osswangxining/conversationinsights-mynlu | d2a174af770a496ef220330cb6d5428f5f0114f6 | [
"Apache-2.0"
] | null | null | null | mynlu/registry.py | osswangxining/conversationinsights-mynlu | d2a174af770a496ef220330cb6d5428f5f0114f6 | [
"Apache-2.0"
] | 1 | 2018-06-26T02:54:57.000Z | 2018-06-26T02:54:57.000Z | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import typing
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Text
from typing import Type
from myn... | 35.053097 | 107 | 0.768493 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import typing
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Text
from typing import Type
from myn... | true | true |
1c05f7a1595c5b87e887d0299d31bb9b87d2e224 | 1,316 | py | Python | system/tools/similar/edit_distance_vsm.py | sfsm565826960/Novel2Love | ce7e8d12fedc48573f4b783cc261160b907a2c62 | [
"MIT"
] | 4 | 2019-02-17T22:01:12.000Z | 2021-01-13T06:59:41.000Z | system/tools/similar/edit_distance_vsm.py | sfsm565826960/Novel2Love | ce7e8d12fedc48573f4b783cc261160b907a2c62 | [
"MIT"
] | null | null | null | system/tools/similar/edit_distance_vsm.py | sfsm565826960/Novel2Love | ce7e8d12fedc48573f4b783cc261160b907a2c62 | [
"MIT"
] | null | null | null | #encoding=utf-8
################
# VSM结合EditDistance模型计算标签相似度
###############
from vsm import create_vocabulary, calc_similar, calc_tag_frequency
from edit_distance import edit_distance
from json import dumps
def calc_edit_distance_vector(tag_group, vocabulary, debug=False):
vector = []
for tag in vocabulary:... | 34.631579 | 102 | 0.663374 | from vsm import create_vocabulary, calc_similar, calc_tag_frequency
from edit_distance import edit_distance
from json import dumps
def calc_edit_distance_vector(tag_group, vocabulary, debug=False):
vector = []
for tag in vocabulary:
if len(tag) == 1: vector.append(tag_group.count(tag))
... | false | true |
1c05f8ce7986cad213f64177cf5de385b4a77a25 | 1,137 | py | Python | xlsxwriter/test/comparison/test_print_options04.py | eddiechapman/XlsxWriter | c636117ab30e64e4b7b824c9105595c42887c2c9 | [
"BSD-2-Clause-FreeBSD"
] | 2,766 | 2015-01-02T17:36:42.000Z | 2022-03-31T09:23:30.000Z | xlsxwriter/test/comparison/test_print_options04.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | 683 | 2015-01-03T09:55:02.000Z | 2022-03-31T07:18:15.000Z | xlsxwriter/test/comparison/test_print_options04.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | 636 | 2015-01-05T01:57:08.000Z | 2022-03-25T18:42:41.000Z | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 27.731707 | 91 | 0.599824 |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
def setUp(self):
self.set_filename('print_options04.xlsx')
self.ignore_files = ['xl/printerSettings/printerSettings1.bin',
'xl/... | true | true |
1c05f8e3fed50a321313d8090ee7ff48c7c757f8 | 10,620 | py | Python | face_rhythm/util/setup.py | bernardosabatinilab/face-rhythm | ea4b5213827beecc174a0f510574d81346b2f07e | [
"MIT"
] | 4 | 2021-03-07T21:19:50.000Z | 2022-01-17T18:19:17.000Z | face_rhythm/util/setup.py | bernardosabatinilab/face-rhythm | ea4b5213827beecc174a0f510574d81346b2f07e | [
"MIT"
] | 4 | 2021-07-15T22:44:59.000Z | 2021-09-17T16:16:20.000Z | face_rhythm/util/setup.py | bernardosabatinilab/face-rhythm | ea4b5213827beecc174a0f510574d81346b2f07e | [
"MIT"
] | 4 | 2021-02-03T15:52:58.000Z | 2022-03-30T23:01:17.000Z | import cv2
import torch
import numpy as np
import yaml
from pathlib import Path
from datetime import datetime
from dateutil.tz import tzlocal
from pynwb import NWBFile, NWBHDF5IO
from face_rhythm.util import helpers
def setup_project(project_path, sessions_path, run_name, overwrite_config, remote, trials, multises... | 33.607595 | 109 | 0.634087 | import cv2
import torch
import numpy as np
import yaml
from pathlib import Path
from datetime import datetime
from dateutil.tz import tzlocal
from pynwb import NWBFile, NWBHDF5IO
from face_rhythm.util import helpers
def setup_project(project_path, sessions_path, run_name, overwrite_config, remote, trials, multises... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.