hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7fa9f14fb566694cd3137372d631c3c4bad4561 | 9,282 | py | Python | content/technical/api/tutorial/python_tutorial/tutorial.py | chris-jan-trapp/easydb-documentation | 7a597a755e11b460f39e0f154d7db038a4e02cb8 | [
"MIT"
] | 3 | 2017-09-06T14:31:13.000Z | 2021-01-06T17:14:30.000Z | content/technical/api/tutorial/python_tutorial/tutorial.py | chris-jan-trapp/easydb-documentation | 7a597a755e11b460f39e0f154d7db038a4e02cb8 | [
"MIT"
] | 10 | 2018-03-20T14:14:56.000Z | 2022-03-08T10:23:00.000Z | content/technical/api/tutorial/python_tutorial/tutorial.py | chris-jan-trapp/easydb-documentation | 7a597a755e11b460f39e0f154d7db038a4e02cb8 | [
"MIT"
] | 4 | 2019-02-21T15:01:14.000Z | 2022-03-08T10:23:14.000Z | import requests
import json
import os
import copy
import argparse
argparser = argparse.ArgumentParser(
description="easydb session creation and search")
argparser.add_argument("-u", "--server_url", help="Url of the server")
argparser.add_argument("-s", "--search", default=[], nargs="*",
hel... | 24.62069 | 107 | 0.612476 | import requests
import json
import os
import copy
import argparse
argparser = argparse.ArgumentParser(
description="easydb session creation and search")
argparser.add_argument("-u", "--server_url", help="Url of the server")
argparser.add_argument("-s", "--search", default=[], nargs="*",
hel... | false | true |
f7fa9fbaf28434362c6e8685f38c9a0bcfbe30a0 | 6,084 | py | Python | qa/rpc-tests/proxy_test.py | Hser2bio/feirm | 4bb1c8e3bdecd9ea449f2148f6b204e1729c3afc | [
"MIT"
] | 4 | 2018-07-16T02:19:59.000Z | 2020-06-17T22:31:41.000Z | qa/rpc-tests/proxy_test.py | Hser2bio/feirm | 4bb1c8e3bdecd9ea449f2148f6b204e1729c3afc | [
"MIT"
] | 2 | 2018-02-15T02:32:36.000Z | 2019-02-06T21:51:35.000Z | qa/rpc-tests/proxy_test.py | Hser2bio/feirm | 4bb1c8e3bdecd9ea449f2148f6b204e1729c3afc | [
"MIT"
] | 10 | 2018-02-26T14:18:54.000Z | 2020-03-27T19:11:49.000Z | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import socket
import traceback, sys
from binascii import hexlify
import time, os
from socks5 import Socks5Conf... | 41.671233 | 145 | 0.652202 |
import socket
import traceback, sys
from binascii import hexlify
import time, os
from socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType
from test_framework import BitcoinTestFramework
from util import *
class ProxyTest(BitcoinTestFramework):
def __init__(self):
... | true | true |
f7fa9fc8ade4c08a30fb61a42306d9397cc5661a | 351 | py | Python | blueprints/AKS/scripts/store_kube_token.py | ahmadiesa-abu/cloudify-web-monitoring-plugin | 65dc04c4d183b097fb7428735955ad1ae6f9b58b | [
"Apache-2.0"
] | null | null | null | blueprints/AKS/scripts/store_kube_token.py | ahmadiesa-abu/cloudify-web-monitoring-plugin | 65dc04c4d183b097fb7428735955ad1ae6f9b58b | [
"Apache-2.0"
] | null | null | null | blueprints/AKS/scripts/store_kube_token.py | ahmadiesa-abu/cloudify-web-monitoring-plugin | 65dc04c4d183b097fb7428735955ad1ae6f9b58b | [
"Apache-2.0"
] | 1 | 2021-05-26T07:08:52.000Z | 2021-05-26T07:08:52.000Z | import base64
from cloudify import ctx
from cloudify.state import ctx_parameters as inputs
from cloudify.manager import get_rest_client
client = get_rest_client()
token = base64.b64decode(inputs['kube_token']).decode('utf-8')
client.secrets.create('kubernetes_token', token, update_if_exists=True)
ctx.instance.runti... | 29.25 | 72 | 0.809117 | import base64
from cloudify import ctx
from cloudify.state import ctx_parameters as inputs
from cloudify.manager import get_rest_client
client = get_rest_client()
token = base64.b64decode(inputs['kube_token']).decode('utf-8')
client.secrets.create('kubernetes_token', token, update_if_exists=True)
ctx.instance.runti... | true | true |
f7faa38321b8877dffdf54f0383438cd5f8f1ca3 | 10,990 | py | Python | futu/quote/quote_response_handler.py | szmile2008/py-futu-api | efe4af5deedf7e030dfe3ee78817f89191821753 | [
"Apache-2.0"
] | 1 | 2019-09-01T08:49:46.000Z | 2019-09-01T08:49:46.000Z | futu/quote/quote_response_handler.py | faruto/py-futu-api | cb274d5ab5387dca190b739d161f2bc8eabe073d | [
"Apache-2.0"
] | null | null | null | futu/quote/quote_response_handler.py | faruto/py-futu-api | cb274d5ab5387dca190b739d161f2bc8eabe073d | [
"Apache-2.0"
] | 1 | 2022-03-26T08:59:12.000Z | 2022-03-26T08:59:12.000Z | # -*- coding: utf-8 -*-
import pandas as pd
from futu.common import RspHandlerBase
from futu.quote.quote_query import *
class StockQuoteHandlerBase(RspHandlerBase):
"""
异步处理推送的订阅股票的报价。
.. code:: python
class StockQuoteTest(StockQuoteHandlerBase):
def on_recv_rsp(self, rsp_str):
... | 30.275482 | 121 | 0.590082 |
import pandas as pd
from futu.common import RspHandlerBase
from futu.quote.quote_query import *
class StockQuoteHandlerBase(RspHandlerBase):
"""
异步处理推送的订阅股票的报价。
.. code:: python
class StockQuoteTest(StockQuoteHandlerBase):
def on_recv_rsp(self, rsp_str):
ret_code, co... | false | true |
f7faa3b7027a00cec360dd10e85f374e66cbb652 | 228 | py | Python | study/w3resource/exercises/python-basic/031 - 060/python-basic - 052.py | gustavomarquezinho/python | e36779aa5c4bfaf88c587f05db5bd447fd41e4a2 | [
"MIT"
] | null | null | null | study/w3resource/exercises/python-basic/031 - 060/python-basic - 052.py | gustavomarquezinho/python | e36779aa5c4bfaf88c587f05db5bd447fd41e4a2 | [
"MIT"
] | null | null | null | study/w3resource/exercises/python-basic/031 - 060/python-basic - 052.py | gustavomarquezinho/python | e36779aa5c4bfaf88c587f05db5bd447fd41e4a2 | [
"MIT"
] | null | null | null | # 052 - Write a Python program to print to stderr.
from __future__ import print_function
from sys import stderr
def printe(*pArgs, **pKwargs):
print(*pArgs, file=stderr, **pKwargs)
printe('abc', 'efg', 'xyzm', sep = '--') | 25.333333 | 50 | 0.688596 |
from __future__ import print_function
from sys import stderr
def printe(*pArgs, **pKwargs):
print(*pArgs, file=stderr, **pKwargs)
printe('abc', 'efg', 'xyzm', sep = '--') | true | true |
f7faa4e358ca07d08708d6decce3527c62206742 | 1,526 | py | Python | Server/ChatBot/venv/Lib/site-packages/pygubu/builder/widgets/tkscrolledframe.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 42 | 2018-12-12T01:00:59.000Z | 2022-03-27T07:32:29.000Z | pygubu/pygubu/builder/widgets/tkscrolledframe.py | GoopyAspirin/python-rsa | 1779b35ee0abe80b44be77fe2e26c7fc26765c1c | [
"MIT"
] | 13 | 2020-11-06T13:50:45.000Z | 2022-01-25T07:17:37.000Z | pygubu/pygubu/builder/widgets/tkscrolledframe.py | GoopyAspirin/python-rsa | 1779b35ee0abe80b44be77fe2e26c7fc26765c1c | [
"MIT"
] | 8 | 2020-11-14T04:30:26.000Z | 2021-01-16T17:55:19.000Z | from __future__ import unicode_literals
from pygubu.builder.builderobject import *
from pygubu.widgets.tkscrolledframe import TkScrolledFrame
class TKScrolledFrameBO(BuilderObject):
class_ = TkScrolledFrame
container = True
# maxchildren = 1
# allowed_children = ('tk.Frame', 'ttk.Frame' )
OPTIONS_S... | 39.128205 | 85 | 0.68021 | from __future__ import unicode_literals
from pygubu.builder.builderobject import *
from pygubu.widgets.tkscrolledframe import TkScrolledFrame
class TKScrolledFrameBO(BuilderObject):
class_ = TkScrolledFrame
container = True
OPTIONS_STANDARD = ('borderwidth', 'cursor', 'highlightbackground',
... | true | true |
f7faa504a00ce7434456dc618e27c739991941e4 | 255 | py | Python | pycristoforo/tests/conftest.py | samdobson/PyCristoforo | 5d631494e95881ef13c8dbe0e93e89b71a860782 | [
"MIT"
] | 27 | 2019-08-02T19:20:07.000Z | 2022-03-19T02:15:22.000Z | pycristoforo/tests/conftest.py | samdobson/PyCristoforo | 5d631494e95881ef13c8dbe0e93e89b71a860782 | [
"MIT"
] | 14 | 2019-06-21T07:29:54.000Z | 2022-03-20T22:51:10.000Z | pycristoforo/tests/conftest.py | samdobson/PyCristoforo | 5d631494e95881ef13c8dbe0e93e89b71a860782 | [
"MIT"
] | 6 | 2020-03-14T10:32:19.000Z | 2021-06-11T00:10:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Dummy conftest.py for pycristoforo.
If you don't know what this is for, just leave it empty.
Read more about conftest.py under:
https://pytest.org/latest/plugins.html
"""
# import pytest
| 21.25 | 60 | 0.658824 | true | true | |
f7faa6847ba11bee709266225a83f23c1471678b | 1,499 | py | Python | django_tally/user_def/group_tally.py | CodeYellowBV/django-tally | a705821050da912fb8dabd56c41c040ea0a00a21 | [
"MIT"
] | null | null | null | django_tally/user_def/group_tally.py | CodeYellowBV/django-tally | a705821050da912fb8dabd56c41c040ea0a00a21 | [
"MIT"
] | null | null | null | django_tally/user_def/group_tally.py | CodeYellowBV/django-tally | a705821050da912fb8dabd56c41c040ea0a00a21 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.postgres import fields as pg_fields
from ..data import DBStored
from ..group import Group
from .tally import UserDefTallyBaseNonStored
from .lang import run, Env
from .lang.json import decode
class UserDefGroupTallyBaseNonStored(UserDefTallyBaseNonStored):
get_gr... | 26.298246 | 75 | 0.631755 | from django.db import models
from django.contrib.postgres import fields as pg_fields
from ..data import DBStored
from ..group import Group
from .tally import UserDefTallyBaseNonStored
from .lang import run, Env
from .lang.json import decode
class UserDefGroupTallyBaseNonStored(UserDefTallyBaseNonStored):
get_gr... | true | true |
f7faa7b3d23f7446d47189e1735febe215ffdf4a | 5,440 | py | Python | miqa/core/rest/session.py | girder/miqa | 756675481c6a11c02134acbde405bfafc9d06b87 | [
"Apache-2.0"
] | 1 | 2021-05-26T18:49:52.000Z | 2021-05-26T18:49:52.000Z | miqa/core/rest/session.py | girder/miqa | 756675481c6a11c02134acbde405bfafc9d06b87 | [
"Apache-2.0"
] | 8 | 2021-04-29T17:25:28.000Z | 2021-05-27T15:09:20.000Z | miqa/core/rest/session.py | girder/miqa | 756675481c6a11c02134acbde405bfafc9d06b87 | [
"Apache-2.0"
] | null | null | null | import os
from pathlib import Path
import re
from drf_yasg.utils import no_body, swagger_auto_schema
from jsonschema import validate
from jsonschema.exceptions import ValidationError as JSONValidationError
from rest_framework import serializers, status
from rest_framework.decorators import action
from rest_framework.e... | 37.260274 | 90 | 0.605882 | import os
from pathlib import Path
import re
from drf_yasg.utils import no_body, swagger_auto_schema
from jsonschema import validate
from jsonschema.exceptions import ValidationError as JSONValidationError
from rest_framework import serializers, status
from rest_framework.decorators import action
from rest_framework.e... | true | true |
f7faa7c94e31717dd3bfb2b1c2c2f3bbb745911d | 8,409 | py | Python | salt/states/modjk_worker.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 1 | 2021-04-05T19:46:35.000Z | 2021-04-05T19:46:35.000Z | salt/states/modjk_worker.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 1 | 2019-09-06T13:57:28.000Z | 2019-09-06T13:57:28.000Z | salt/states/modjk_worker.py | pass-by-value/salt | 2ede44fe54516242e10fe428629d5f5a18e5f7ea | [
"Apache-2.0",
"MIT"
] | 1 | 2020-09-30T16:09:48.000Z | 2020-09-30T16:09:48.000Z | # -*- coding: utf-8 -*-
'''
Manage modjk workers
====================
Send commands to a :strong:`modjk` load balancer via the peer system.
This module can be used with the :ref:`prereq <requisites-prereq>`
requisite to remove/add the worker from the load balancer before
deploying/restarting service.
Mandatory Setti... | 30.467391 | 84 | 0.593769 |
from __future__ import absolute_import
import salt.utils
def __virtual__():
return True
def _send_command(cmd,
worker,
lbn,
target,
profile='default',
tgt_type='glob'):
ret = {
'code': False,
'msg': '... | true | true |
f7faa840392864362dd4dafe8279ea33bdfe883c | 1,689 | py | Python | Chap 2/Chap-2-Proj-Bowling.py | dwhickox/NCHS-Programming-1-Python-Programs | 96eba3826585a81a015740f59329c7a06afc9db7 | [
"MIT"
] | null | null | null | Chap 2/Chap-2-Proj-Bowling.py | dwhickox/NCHS-Programming-1-Python-Programs | 96eba3826585a81a015740f59329c7a06afc9db7 | [
"MIT"
] | null | null | null | Chap 2/Chap-2-Proj-Bowling.py | dwhickox/NCHS-Programming-1-Python-Programs | 96eba3826585a81a015740f59329c7a06afc9db7 | [
"MIT"
] | null | null | null | #David Hickox
#jan 24 17
#Bowling Prgm
#Calculates the Bowling averages and totals
#variables
# kim1-3, holds the scores for kim
# kourt1-3, holds the scores for kourtney
# poptart1-3, holds Mr. Hayes' scores
# epstein1-3, holds Mrs. Epstein's scores
# kimave, kim's average
# kourtave, kourtney's average
# poptartave... | 29.631579 | 108 | 0.745411 |
# epstein1-3, holds Mrs. Epstein's scores
# kourtave, kourtney's average
# epsteinave, Mrs. Epstein's average
cale
locale.setlocale( locale.LC_ALL, '' )
#use locale.currency() for currency formating
print("Welcome to the Bowling Program\n")
#initializes all the values
kim1 = 101
kim2 = 126
kim3 = 132
kourt... | true | true |
f7faa87c8956ffaf946e44fe4188181df5f38082 | 7,935 | py | Python | src/test/python/org/o3project/odenos/core/component/network/flow/test_flow.py | o3project/odenos | 837d0d3d3c37482e843c40c5eeeac10646e68c65 | [
"Apache-2.0"
] | 26 | 2015-02-18T10:22:50.000Z | 2020-06-18T05:07:54.000Z | src/test/python/org/o3project/odenos/core/component/network/flow/test_flow.py | o3project/odenos | 837d0d3d3c37482e843c40c5eeeac10646e68c65 | [
"Apache-2.0"
] | 45 | 2015-02-20T00:40:45.000Z | 2021-12-14T21:07:57.000Z | src/test/python/org/o3project/odenos/core/component/network/flow/test_flow.py | o3project/odenos | 837d0d3d3c37482e843c40c5eeeac10646e68c65 | [
"Apache-2.0"
] | 30 | 2015-02-19T02:00:35.000Z | 2017-02-18T15:28:09.000Z | # -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... | 41.984127 | 77 | 0.558916 |
from org.o3project.odenos.core.component.network.flow.flow import Flow
import unittest
class FlowTest(unittest.TestCase):
Type = "BasicFlow"
Version = "v01"
Flow_id = "Id01"
Owner = "Owner"
Enabled = True
Priority = 65535
Status = "none"
Attributes = {"bandwidth": 10, "req_bandwidt... | true | true |
f7faa989d90b294b105b860f6bf0d66bb6d3a8fe | 768 | py | Python | BasicPythonPrograms/PythonInheritance.py | Pushkar745/PythonProgramming | ea60e97b70d46fb63ef203913c8b3f9570232dd3 | [
"Apache-2.0"
] | null | null | null | BasicPythonPrograms/PythonInheritance.py | Pushkar745/PythonProgramming | ea60e97b70d46fb63ef203913c8b3f9570232dd3 | [
"Apache-2.0"
] | null | null | null | BasicPythonPrograms/PythonInheritance.py | Pushkar745/PythonProgramming | ea60e97b70d46fb63ef203913c8b3f9570232dd3 | [
"Apache-2.0"
] | null | null | null | class Person:
def __init__(self,fname,lname):
self.firstname=fname #proerties
self.lastname=lname
def printname(self): #Method
print(self.firstname,self.lastname)
class Student(Person): #child class
def __init__(self, fname, lname):
Person.__init__(self, fname, lname)
... | 34.909091 | 87 | 0.700521 | class Person:
def __init__(self,fname,lname):
self.firstname=fname
self.lastname=lname
def printname(self):
print(self.firstname,self.lastname)
class Student(Person):
def __init__(self, fname, lname):
Person.__init__(self, fname, lname)
super().__init__(fname,ln... | true | true |
f7faa9cd76e458ca86b43c3b1502fade86146a38 | 587 | py | Python | visitingController.py | C1626152/bfrp | 2d43f90ba08709446c70453b758c42bb41e5946b | [
"MIT"
] | 1 | 2019-03-05T11:36:17.000Z | 2019-03-05T11:36:17.000Z | visitingController.py | C1626152/bfrp | 2d43f90ba08709446c70453b758c42bb41e5946b | [
"MIT"
] | 1 | 2019-03-12T00:09:09.000Z | 2019-03-12T00:09:09.000Z | visitingController.py | C1626152/bfrp | 2d43f90ba08709446c70453b758c42bb41e5946b | [
"MIT"
] | 2 | 2019-02-14T20:35:34.000Z | 2019-03-05T11:45:54.000Z | import microbit
import radio
# turn radio on
radio.on()
# set channel, power to max, assign group
radio.config(channel=7, power=10, group=1)
tX = radio.send()
rX = radio.receive()
dict currentBlock = []
# While loop to send beacon signal
while rX == False:
tX = "SYN"
if rX == "ACK":
# Placeholder in use here
tX ... | 20.241379 | 61 | 0.698467 | import microbit
import radio
radio.on()
radio.config(channel=7, power=10, group=1)
tX = radio.send()
rX = radio.receive()
dict currentBlock = []
while rX == False:
tX = "SYN"
if rX == "ACK":
tX = "someHashcode"
elif type(rX) == str && len(rX) == 32:
currentBlock = rX
else:
return
| false | true |
f7faaa3340fb48ef829d4e5d6b48af6f8a62c2c9 | 1,010 | py | Python | examples/2_docking/pose_prediction/run.py | jurgjn/hotspots | ef1fc6dd957a2f23094e10c05c702b5ed94a59ac | [
"MIT"
] | 24 | 2019-02-14T00:02:13.000Z | 2022-03-26T02:27:52.000Z | examples/2_docking/pose_prediction/run.py | jurgjn/hotspots | ef1fc6dd957a2f23094e10c05c702b5ed94a59ac | [
"MIT"
] | 27 | 2019-02-06T12:18:27.000Z | 2020-10-30T14:26:08.000Z | examples/2_docking/pose_prediction/run.py | jurgjn/hotspots | ef1fc6dd957a2f23094e10c05c702b5ed94a59ac | [
"MIT"
] | 12 | 2019-02-13T20:38:56.000Z | 2022-03-09T01:20:54.000Z | from __future__ import print_function
import os
#####################################################################
# input data
prot = "1m17" # protein to dock into
ligand = "AQ4" # ligand to dock
ref = "1m17" # reference structure for comparison
##################################################... | 36.071429 | 120 | 0.573267 | from __future__ import print_function
import os
| true | true |
f7faaa4287c34b67f0176d4206a4ebfccc2e4186 | 23,027 | py | Python | sdk/python/pulumi_azure/keyvault/certifiate.py | adnang/pulumi-azure | 32360d2f1e41e27d7fdd6522cb26d65e531f279f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/keyvault/certifiate.py | adnang/pulumi-azure | 32360d2f1e41e27d7fdd6522cb26d65e531f279f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/keyvault/certifiate.py | adnang/pulumi-azure | 32360d2f1e41e27d7fdd6522cb26d65e531f279f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
warnings.war... | 64.682584 | 343 | 0.642507 |
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
warnings.warn("azure.keyvault.Certifiate has been deprecated in favor of azure.keyvault.Certificate", DeprecationWarning)
class Certifiate(pulumi.CustomResource):
certificate: pulumi.Output... | true | true |
f7faaa467764b3cb87d3c87d86a6e208de610871 | 4,012 | py | Python | examples/test_demo_site.py | johnhiggs/SeleniumBase | 2cbb156e1351bc4ab36a2975c000a406c6ee8f3a | [
"MIT"
] | 3 | 2020-06-30T19:12:01.000Z | 2020-07-03T05:22:25.000Z | examples/test_demo_site.py | johnhiggs/SeleniumBase | 2cbb156e1351bc4ab36a2975c000a406c6ee8f3a | [
"MIT"
] | null | null | null | examples/test_demo_site.py | johnhiggs/SeleniumBase | 2cbb156e1351bc4ab36a2975c000a406c6ee8f3a | [
"MIT"
] | null | null | null | from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_demo_site(self):
self.open("https://seleniumbase.io/demo_page/")
# Assert the title of the current web page
self.assert_title("Web Testing Page")
# Assert that the element is visible on the page
self... | 39.333333 | 62 | 0.66002 | from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_demo_site(self):
self.open("https://seleniumbase.io/demo_page/")
self.assert_title("Web Testing Page")
self.assert_element("tbody#tbodyId")
self.assert_text("Demo Page", "h1")
... | true | true |
f7faaab4227cd17ca2d0de0c99bfceff25010f0c | 754 | py | Python | pi-thon.py | Cydox/pi-thon | b9a3bb23bcbf0ee6b0caf68f9a6d73bcebce2b94 | [
"MIT"
] | null | null | null | pi-thon.py | Cydox/pi-thon | b9a3bb23bcbf0ee6b0caf68f9a6d73bcebce2b94 | [
"MIT"
] | null | null | null | pi-thon.py | Cydox/pi-thon | b9a3bb23bcbf0ee6b0caf68f9a6d73bcebce2b94 | [
"MIT"
] | null | null | null | import os
f = open("pi-decimals.txt")
lines = f.readlines()
f.close()
pi = ""
for i in range(len(lines)):
pi += lines[i].replace("\r", "").replace("\n", "")
answer = raw_input ("Enter pi from memory: ")
for i in range(len(answer)):
if not answer[i] == pi[i]:
break
print "Your score from memory:", i - 1
raw_input... | 20.378378 | 75 | 0.606101 | import os
f = open("pi-decimals.txt")
lines = f.readlines()
f.close()
pi = ""
for i in range(len(lines)):
pi += lines[i].replace("\r", "").replace("\n", "")
answer = raw_input ("Enter pi from memory: ")
for i in range(len(answer)):
if not answer[i] == pi[i]:
break
print "Your score from memory:", i - 1
raw_input... | false | true |
f7faab0687606af0a5b876ef8dd2381a4cbd1153 | 3,980 | py | Python | svg.py | cornelius/beautiful-labels | 23d8f0ab08a77c785f348dd883518b372ffbc725 | [
"MIT"
] | null | null | null | svg.py | cornelius/beautiful-labels | 23d8f0ab08a77c785f348dd883518b372ffbc725 | [
"MIT"
] | 1 | 2019-04-12T12:41:36.000Z | 2019-04-12T12:41:36.000Z | svg.py | cornelius/beautiful-labels | 23d8f0ab08a77c785f348dd883518b372ffbc725 | [
"MIT"
] | 2 | 2019-02-22T17:36:06.000Z | 2020-02-14T20:09:25.000Z | class Tag:
def __init__(self, doc, name):
self.doc = doc
self.name = name
def __enter__(self):
self.doc.level += 1
def __exit__(self, type, value, traceback):
self.doc.level -= 1
if self.doc.open_tag:
self.doc.out += "/>\n"
self.open_tag = Fa... | 34.310345 | 132 | 0.546734 | class Tag:
def __init__(self, doc, name):
self.doc = doc
self.name = name
def __enter__(self):
self.doc.level += 1
def __exit__(self, type, value, traceback):
self.doc.level -= 1
if self.doc.open_tag:
self.doc.out += "/>\n"
self.open_tag = Fa... | true | true |
f7faabf273c6a4e6495383d367209960633a73f2 | 285 | py | Python | program_data/clean_404.py | yifan-zhou19/ggnn_graph_classification | 37bca1315fdf95933f52b4cd504ce89a768a86df | [
"MIT"
] | 19 | 2019-02-26T05:43:39.000Z | 2022-02-21T04:14:46.000Z | program_data/clean_404.py | yifan-zhou19/ggnn_graph_classification | 37bca1315fdf95933f52b4cd504ce89a768a86df | [
"MIT"
] | null | null | null | program_data/clean_404.py | yifan-zhou19/ggnn_graph_classification | 37bca1315fdf95933f52b4cd504ce89a768a86df | [
"MIT"
] | 8 | 2018-12-25T02:05:41.000Z | 2022-02-23T07:50:48.000Z | import os
path = "github_cpp_program_data"
for root, dirs, files in os.walk(path, topdown=False):
for file in files:
file_path = os.path.join(root, file)
with open(file_path, "r") as f:
data = str(f.read())
if "404" in data:
print(file_path)
os.remove(file_path)
| 23.75 | 54 | 0.670175 | import os
path = "github_cpp_program_data"
for root, dirs, files in os.walk(path, topdown=False):
for file in files:
file_path = os.path.join(root, file)
with open(file_path, "r") as f:
data = str(f.read())
if "404" in data:
print(file_path)
os.remove(file_path)
| true | true |
f7faacf8b915b685fa246da285be95cd96ee9acd | 6,967 | py | Python | model/vgg19/model4_val5.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | 3 | 2018-05-06T15:15:21.000Z | 2018-05-13T12:31:42.000Z | model/vgg19/model4_val5.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | null | null | null | model/vgg19/model4_val5.py | wan-h/JD-AI-Fashion-Challenge | 817f693672f418745e3a4c89a0417a3165b08130 | [
"MIT"
] | null | null | null | """
以model 2为基础,新增real crop
"""
import math
import os
import queue
import time
import keras
from keras.layers import Dense, BatchNormalization, Activation
import config
from util import data_loader
from util import keras_util
from util.keras_util import KerasModelConfig
model_config = KerasModelConfig(k_fold_file="1... | 51.227941 | 129 | 0.519736 | import math
import os
import queue
import time
import keras
from keras.layers import Dense, BatchNormalization, Activation
import config
from util import data_loader
from util import keras_util
from util.keras_util import KerasModelConfig
model_config = KerasModelConfig(k_fold_file="1.txt",
... | true | true |
f7faad658eda1d9df5d5b8de9498b459d238904e | 59 | py | Python | settings.py | tburrows13/perudo-online | b88c5c9aa0957abd99f87d1653216edded1130b9 | [
"MIT"
] | 1 | 2018-06-08T16:56:48.000Z | 2018-06-08T16:56:48.000Z | settings.py | tburrows13/perudo-online | b88c5c9aa0957abd99f87d1653216edded1130b9 | [
"MIT"
] | null | null | null | settings.py | tburrows13/perudo-online | b88c5c9aa0957abd99f87d1653216edded1130b9 | [
"MIT"
] | 1 | 2020-10-22T13:12:11.000Z | 2020-10-22T13:12:11.000Z | server_ip = "localhost"
server_port = 20006
MAX_PLAYERS = 6 | 19.666667 | 23 | 0.779661 | server_ip = "localhost"
server_port = 20006
MAX_PLAYERS = 6 | true | true |
f7faad77d6b11163642289c028ca1c22d9ca22a1 | 16,330 | py | Python | tests/rule_based_profiler/parameter_builder/test_parameter_container.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | tests/rule_based_profiler/parameter_builder/test_parameter_container.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | tests/rule_based_profiler/parameter_builder/test_parameter_container.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List
from great_expectations.execution_engine.execution_engine import MetricDomainTypes
from great_expectations.rule_based_profiler.types import (
Domain,
ParameterContainer,
ParameterNode,
build_parameter_container,
build_parameter_container_for_variables,
get_fully_qu... | 32.791165 | 95 | 0.395407 | from typing import Dict, List
from great_expectations.execution_engine.execution_engine import MetricDomainTypes
from great_expectations.rule_based_profiler.types import (
Domain,
ParameterContainer,
ParameterNode,
build_parameter_container,
build_parameter_container_for_variables,
get_fully_qu... | true | true |
f7faade87f6260f80c525f74f167ed204f2a0750 | 18,601 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_ltl_timed_transition_system/15-sender_receiver_35.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_ltl_timed_transition_system/15-sender_receiver_35.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_ltl_timed_transition_system/15-sender_receiver_35.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msa... | 38.273663 | 89 | 0.576582 | from typing import FrozenSet
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msa... | true | true |
f7faae0860a8a5881c97468472d89213b45e7587 | 807 | py | Python | connections/singletonConnection.py | Link-Hawks/Edgar | af734f212a7ec3d476ff67e5fc253e47ca597f8b | [
"MIT"
] | null | null | null | connections/singletonConnection.py | Link-Hawks/Edgar | af734f212a7ec3d476ff67e5fc253e47ca597f8b | [
"MIT"
] | null | null | null | connections/singletonConnection.py | Link-Hawks/Edgar | af734f212a7ec3d476ff67e5fc253e47ca597f8b | [
"MIT"
] | 2 | 2019-04-01T06:37:25.000Z | 2019-05-23T01:03:29.000Z | from os import system
from pymongo import MongoClient
class SingletonConnection(object):
__cliente = None
@classmethod
def get_connection(cls):
if cls.__cliente is None:
cls.__cliente = MongoClient('127.0.0.1', 27017)
return cls.__cliente
@classmethod
def get_banco(c... | 26.9 | 78 | 0.684015 | from os import system
from pymongo import MongoClient
class SingletonConnection(object):
__cliente = None
@classmethod
def get_connection(cls):
if cls.__cliente is None:
cls.__cliente = MongoClient('127.0.0.1', 27017)
return cls.__cliente
@classmethod
def get_banco(c... | true | true |
f7faae9a2f8f7c1837b8bcf3604b4e880e6dbe20 | 2,018 | py | Python | resize.py | hwine/mg-resize-images-for-social | 15077d0e482717f422d96f9c5ec95aa0a975e33c | [
"MIT"
] | null | null | null | resize.py | hwine/mg-resize-images-for-social | 15077d0e482717f422d96f9c5ec95aa0a975e33c | [
"MIT"
] | 2 | 2022-03-07T19:20:40.000Z | 2022-03-07T22:30:18.000Z | resize.py | hwine/mg-resize-images-for-social | 15077d0e482717f422d96f9c5ec95aa0a975e33c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
from collections import namedtuple
from gooey import Gooey, GooeyParser
from PIL import Image
"""
Instagram can host a single image, or a grouping of images that we create a "gallery" image in the size for Instagram - 1080 x 1080 px
Facebook image size - 1200 x630 ... | 30.119403 | 138 | 0.667988 |
import os
import sys
from collections import namedtuple
from gooey import Gooey, GooeyParser
from PIL import Image
Site = namedtuple("Site", "name hint max_x max_y")
sites = [
Site("Instagram", "ig", 1080, 1080),
Site("Facebood", "fb", 1200, 630),
Site("FB_event", "fbe", 1920, 630),
Site("EventBrite... | true | true |
f7faafa42f04eb2bc9058050fa2eb4c9acc14640 | 1,775 | py | Python | tethysext/atcore/models/resource_workflow_steps/form_input_rws.py | Aquaveo/tethysext-atcore | 7a83ccea24fdbbe806f12154f938554dd6c8015f | [
"BSD-3-Clause"
] | 3 | 2020-11-05T23:50:47.000Z | 2021-02-26T21:43:29.000Z | tethysext/atcore/models/resource_workflow_steps/form_input_rws.py | Aquaveo/tethysext-atcore | 7a83ccea24fdbbe806f12154f938554dd6c8015f | [
"BSD-3-Clause"
] | 7 | 2020-10-29T16:53:49.000Z | 2021-05-07T19:46:47.000Z | tethysext/atcore/models/resource_workflow_steps/form_input_rws.py | Aquaveo/tethysext-atcore | 7a83ccea24fdbbe806f12154f938554dd6c8015f | [
"BSD-3-Clause"
] | null | null | null | """
********************************************************************************
* Name: form_input_rws.py
* Author: glarsen, mlebaron
* Created On: October 17, 2019
* Copyright: (c) Aquaveo 2019
********************************************************************************
"""
from tethysext.atcore.models.app_us... | 32.87037 | 104 | 0.540282 | from tethysext.atcore.models.app_users import ResourceWorkflowStep
class FormInputRWS(ResourceWorkflowStep):
CONTROLLER = 'tethysext.atcore.controllers.resource_workflows.workflow_views.FormInputWV'
TYPE = 'form_input_resource_workflow_step'
__mapper_args__ = {
'polymorphic_identity': TYPE
}... | true | true |
f7faafb2fccf9b24e7da2a4d923d2cd8ed2b0334 | 666 | py | Python | log/migrations/0003_auto_20190209_1009.py | zyayoung/lab-item-tracking | 6d0ee000114300d6693ec078f974b9a6ef4dfe40 | [
"MIT"
] | 4 | 2019-01-14T15:44:22.000Z | 2019-01-16T16:07:19.000Z | log/migrations/0003_auto_20190209_1009.py | zyayoung/lab-item-tracking | 6d0ee000114300d6693ec078f974b9a6ef4dfe40 | [
"MIT"
] | 2 | 2019-02-01T00:50:20.000Z | 2019-02-22T15:15:54.000Z | log/migrations/0003_auto_20190209_1009.py | zyayoung/lab-item-tracking | 6d0ee000114300d6693ec078f974b9a6ef4dfe40 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.1 on 2019-02-09 10:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('log', '0002_auto_20190209_0933'),
]
operations = [
migrations.RemoveField(
model_name='log',
name='obj',
),
... | 23.785714 | 77 | 0.551051 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('log', '0002_auto_20190209_0933'),
]
operations = [
migrations.RemoveField(
model_name='log',
name='obj',
),
migrations.AddField(
model_... | true | true |
f7faafe986c505534c2ecfa2be83b48562cd299a | 867 | py | Python | test/get_value.py | seriesdb/seriesdb-client-python | bdd341af6e409f65394f728de5ed6e37b9860d78 | [
"MIT"
] | null | null | null | test/get_value.py | seriesdb/seriesdb-client-python | bdd341af6e409f65394f728de5ed6e37b9860d78 | [
"MIT"
] | null | null | null | test/get_value.py | seriesdb/seriesdb-client-python | bdd341af6e409f65394f728de5ed6e37b9860d78 | [
"MIT"
] | null | null | null | import asyncio
import traceback
import struct
import pycommons.logger
from seriesdb.client import Client
logger = pycommons.logger.get_instance(__name__)
count = 0
async def get_value():
loop = asyncio.get_event_loop()
client = Client("localhost:8888", loop=loop)
global count
while True:
tr... | 24.083333 | 71 | 0.611303 | import asyncio
import traceback
import struct
import pycommons.logger
from seriesdb.client import Client
logger = pycommons.logger.get_instance(__name__)
count = 0
async def get_value():
loop = asyncio.get_event_loop()
client = Client("localhost:8888", loop=loop)
global count
while True:
tr... | true | true |
f7fab11858d4b7e1ee32d1c78df0882a18aea998 | 1,491 | py | Python | src/wavestate/model/optics/alm/substrates.py | wavestate/wavestate-model | d5e9cd3bd7352e07cc789b40a4d9452975b27237 | [
"Apache-2.0"
] | null | null | null | src/wavestate/model/optics/alm/substrates.py | wavestate/wavestate-model | d5e9cd3bd7352e07cc789b40a4d9452975b27237 | [
"Apache-2.0"
] | null | null | null | src/wavestate/model/optics/alm/substrates.py | wavestate/wavestate-model | d5e9cd3bd7352e07cc789b40a4d9452975b27237 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology.
# SPDX-FileCopyrightText: © 2021 Lee McCuller <mcculler@mit.edu>
# NOTICE: authors should document their contributions in concisely in NOTICE
# with details inline ... | 31.723404 | 125 | 0.587525 |
from ...base import FrequencyKey
substrates = dict(
fused_silica={
FrequencyKey({"Nd1064": 1}): 1.4496,
FrequencyKey({"Nd1064": 2}): 1.4607,
FrequencyKey({"1550": 1}): 1.440,
FrequencyKey({"1550": 2}): 1.4538,
"Sellmeier": None,
},
silicon=... | true | true |
f7fab265f4bdb814cf259fcfe5376acd8f3f8679 | 8,812 | py | Python | Code/hashtable.py | omarsagoo/CS-1.3-Core-Data-Structures | fd48ca53910bcebb3d2d4d48c56ca5e176fb0246 | [
"MIT"
] | null | null | null | Code/hashtable.py | omarsagoo/CS-1.3-Core-Data-Structures | fd48ca53910bcebb3d2d4d48c56ca5e176fb0246 | [
"MIT"
] | 6 | 2020-02-14T18:35:53.000Z | 2020-03-09T20:14:06.000Z | Code/hashtable.py | omarsagoo/CS-1.3-Core-Data-Structures | fd48ca53910bcebb3d2d4d48c56ca5e176fb0246 | [
"MIT"
] | 1 | 2020-05-15T22:09:15.000Z | 2020-05-15T22:09:15.000Z | #!python
from linkedlist import LinkedList
class HashTable(object):
def __init__(self, init_size=8):
"""Initialize this hash table with the given initial size."""
self.buckets = [LinkedList() for i in range(init_size)]
self.size = 0 # Number of key-value entries
def __str__(self):
... | 41.17757 | 80 | 0.601339 |
from linkedlist import LinkedList
class HashTable(object):
def __init__(self, init_size=8):
self.buckets = [LinkedList() for i in range(init_size)]
self.size = 0
def __str__(self):
items = ['{!r}: {!r}'.format(key, val) for key, val in self.items()]
return '{' + ', '.join... | true | true |
f7fab2882ba44013b1ca7273273e6b041c1e46c3 | 1,301 | py | Python | costor_server/storage/api/views/authcheck.py | rphi/costor | 081de65778d404cf7a22c5524bf89a146fa8326b | [
"CNRI-Python"
] | 2 | 2019-12-31T16:49:36.000Z | 2021-02-17T09:47:41.000Z | costor_server/storage/api/views/authcheck.py | rphi/costor | 081de65778d404cf7a22c5524bf89a146fa8326b | [
"CNRI-Python"
] | null | null | null | costor_server/storage/api/views/authcheck.py | rphi/costor | 081de65778d404cf7a22c5524bf89a146fa8326b | [
"CNRI-Python"
] | null | null | null | from rest_framework.decorators import api_view, permission_classes
from rest_framework.parsers import MultiPartParser
from rest_framework.response import Response
from rest_framework import permissions
from rest_framework.exceptions import APIException
from rest_framework.decorators import parser_classes
from django.sh... | 30.97619 | 117 | 0.704074 | from rest_framework.decorators import api_view, permission_classes
from rest_framework.parsers import MultiPartParser
from rest_framework.response import Response
from rest_framework import permissions
from rest_framework.exceptions import APIException
from rest_framework.decorators import parser_classes
from django.sh... | true | true |
f7fab2df7376188532f564c19c48e06c3e9af63f | 3,804 | py | Python | huaweicloud-sdk-bss/huaweicloudsdkbss/v2/model/list_free_resource_usages_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-bss/huaweicloudsdkbss/v2/model/list_free_resource_usages_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-bss/huaweicloudsdkbss/v2/model/list_free_resource_usages_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ListFreeResourceUsagesRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dic... | 27.171429 | 80 | 0.571767 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ListFreeResourceUsagesRequest:
sensitive_list = []
openapi_types = {
'x_language': 'str',
'body': 'ListFreeResourceUsagesReq'
}
attribute_map = {
'x_language': 'X-Lan... | true | true |
f7fab2e625c0265f8763f47d55ab85af7c523b95 | 898 | py | Python | tests/metrics/test_silhouette_metrics.py | gokceneraslan/scib | 91cfe2e4872230d8806c8f9ad5a0c251f268fdc4 | [
"MIT"
] | 1 | 2021-04-06T09:28:09.000Z | 2021-04-06T09:28:09.000Z | tests/metrics/test_silhouette_metrics.py | qqdb/scib | 7d11d7959baaebc3ad588356407a78ac2c3271f4 | [
"MIT"
] | null | null | null | tests/metrics/test_silhouette_metrics.py | qqdb/scib | 7d11d7959baaebc3ad588356407a78ac2c3271f4 | [
"MIT"
] | null | null | null | from tests.common import *
def test_silhouette(adata_pca):
score = scIB.me.silhouette(
adata_pca,
group_key='celltype',
embed='X_pca',
scale=True
)
LOGGER.info(f"score: {score}")
assert 0 <= score <= 1
def test_silhouette_batch(adata_pca):
_, sil = scIB.me.silhoue... | 21.902439 | 47 | 0.58686 | from tests.common import *
def test_silhouette(adata_pca):
score = scIB.me.silhouette(
adata_pca,
group_key='celltype',
embed='X_pca',
scale=True
)
LOGGER.info(f"score: {score}")
assert 0 <= score <= 1
def test_silhouette_batch(adata_pca):
_, sil = scIB.me.silhoue... | true | true |
f7fab3a6960181d694c6e03a208191c3808a326f | 49,550 | py | Python | BinanceWatch/storage/BinanceDataBase.py | jontstaz/BinanceWatch | 824daf452164fa4970bffe6e7639fe2bd594f857 | [
"MIT"
] | 2 | 2021-05-02T11:07:44.000Z | 2021-05-06T13:00:36.000Z | BinanceWatch/storage/BinanceDataBase.py | jontstaz/BinanceWatch | 824daf452164fa4970bffe6e7639fe2bd594f857 | [
"MIT"
] | null | null | null | BinanceWatch/storage/BinanceDataBase.py | jontstaz/BinanceWatch | 824daf452164fa4970bffe6e7639fe2bd594f857 | [
"MIT"
] | null | null | null | import datetime
from typing import Optional
from BinanceWatch.storage.DataBase import DataBase, SQLConditionEnum
from BinanceWatch.storage import tables
from BinanceWatch.utils.time_utils import datetime_to_millistamp
class BinanceDataBase(DataBase):
"""
Handles the recording of the binance account in a loca... | 41.395155 | 118 | 0.565308 | import datetime
from typing import Optional
from BinanceWatch.storage.DataBase import DataBase, SQLConditionEnum
from BinanceWatch.storage import tables
from BinanceWatch.utils.time_utils import datetime_to_millistamp
class BinanceDataBase(DataBase):
def __init__(self, name: str = 'binance_db'):
super()... | true | true |
f7fab899a40af0955de3abfc841878e7f2bed3cc | 12,469 | py | Python | InputConfiguration/translator.py | ashleygw/video-manipulation | 351a904c5f10168e43f4afd4375c15d584b68d61 | [
"MIT"
] | 2 | 2018-08-30T02:59:26.000Z | 2019-04-02T19:23:57.000Z | InputConfiguration/translator.py | ashleygw/video-manipulation | 351a904c5f10168e43f4afd4375c15d584b68d61 | [
"MIT"
] | 24 | 2019-03-02T00:09:58.000Z | 2019-04-29T18:39:42.000Z | InputConfiguration/translator.py | ashleygw/video-manipulation | 351a904c5f10168e43f4afd4375c15d584b68d61 | [
"MIT"
] | 2 | 2018-09-11T17:03:41.000Z | 2018-10-02T23:09:40.000Z | # File to translate .pde sketch files to quad objects
# ready for our program.
# Cleanup infile
# Reorganize the file
# Indenting?
# conversion from cc[] to correct mappin -
# Translated from midi lines -
# Added absolute path
# Processing writes to map.csv
# Args input
# global variables
# better multiline in gl... | 33.883152 | 762 | 0.554736 |
import sys
import re
import os
from pathlib import Path
mypath = Path().absolute()
func = re.compile(r'^[ \t]*(?:(?:public|protected|private)\s+)?(?:(static|final|native|synchronized|abstract|threadsafe|transient|(?:<[?\w\[\] ,&]+>)|(?:<[^<]*<[?\w\[\] ,&]+>[^>]*>)|(?:<[^<]*<[^<]*<[?\w\[\] ,&]+>... | true | true |
f7fab910bb8a6c6b379d8f8353b85660680173e9 | 1,148 | py | Python | manager/app.py | W-DEJONG/Id-manager | f1fa147f7915da67f545dd1c4dc3abae0a0ac0cc | [
"BSD-3-Clause"
] | 1 | 2022-02-01T10:45:30.000Z | 2022-02-01T10:45:30.000Z | manager/app.py | W-DEJONG/Id-manager | f1fa147f7915da67f545dd1c4dc3abae0a0ac0cc | [
"BSD-3-Clause"
] | null | null | null | manager/app.py | W-DEJONG/Id-manager | f1fa147f7915da67f545dd1c4dc3abae0a0ac0cc | [
"BSD-3-Clause"
] | null | null | null | import os
from flask import Flask, redirect, url_for
from manager import config
from manager.models import db
from manager.oauth2 import config_oauth
from manager.routes import auth, oauth, api, admin
from manager.auth import csrf, login_manager
def create_app(test_config=None):
"""
create and configure the ... | 25.511111 | 70 | 0.684669 | import os
from flask import Flask, redirect, url_for
from manager import config
from manager.models import db
from manager.oauth2 import config_oauth
from manager.routes import auth, oauth, api, admin
from manager.auth import csrf, login_manager
def create_app(test_config=None):
app = Flask(__name__,
... | true | true |
f7fabb36d75130c3b7807e2c5dc6e6309ef4522b | 248 | py | Python | Three/manage.py | LyCq/sanjiliandong | ec0d44073f9b3aa27dee0b2fd23e905ec10c6b7c | [
"MIT"
] | null | null | null | Three/manage.py | LyCq/sanjiliandong | ec0d44073f9b3aa27dee0b2fd23e905ec10c6b7c | [
"MIT"
] | null | null | null | Three/manage.py | LyCq/sanjiliandong | ec0d44073f9b3aa27dee0b2fd23e905ec10c6b7c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Three.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.545455 | 69 | 0.770161 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Three.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
f7fabcd5fedaf3b33fd1f53a6606bb7851beda75 | 939 | py | Python | nova/console/__init__.py | bopopescu/nova-master | 58809056f3a219c6ea3667003f906eeaf581fa95 | [
"Apache-2.0"
] | 7 | 2017-06-19T19:37:00.000Z | 2019-06-16T02:06:14.000Z | nova/console/__init__.py | bopopescu/nova-master | 58809056f3a219c6ea3667003f906eeaf581fa95 | [
"Apache-2.0"
] | null | null | null | nova/console/__init__.py | bopopescu/nova-master | 58809056f3a219c6ea3667003f906eeaf581fa95 | [
"Apache-2.0"
] | 6 | 2015-06-20T16:07:28.000Z | 2020-08-19T14:57:59.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 39.125 | 78 | 0.667732 | true | true | |
f7fabcf67885a460bbc8b45b494d2ecdc3128a16 | 6,294 | py | Python | src/c_json.py | McSCert/C2Flowchart | fbbeba9c4ef477bef8e096a76895e728698ef6cd | [
"BSD-3-Clause"
] | null | null | null | src/c_json.py | McSCert/C2Flowchart | fbbeba9c4ef477bef8e096a76895e728698ef6cd | [
"BSD-3-Clause"
] | null | null | null | src/c_json.py | McSCert/C2Flowchart | fbbeba9c4ef477bef8e096a76895e728698ef6cd | [
"BSD-3-Clause"
] | null | null | null | #------------------------------------------------------------------------------
# pycparser: c_json.py
#
# by Michael White (@mypalmike)
#
# This example includes functions to serialize and deserialize an ast
# to and from json format. Serializing involves walking the ast and converting
# each node from a python Node o... | 30.259615 | 90 | 0.634731 |
# a Coord object into a string of the format "filename:line[:column]".
#
# Example TypeDecl node, with IdentifierType child node, represented as a dict:
# "type": {
# "_nodetype": "TypeDecl",
# "coord": "c_files/funky.c:8",
# "declname": "o",
# "quals": [],
# ... | true | true |
f7fabe374638f660af55150179e4ad424ca381a0 | 2,163 | py | Python | pages/views.py | Manny27nyc/pythondotorg | 257c96d3a94755451a5a5cdcd2abad1e27ea299b | [
"Apache-2.0"
] | 911 | 2015-01-03T22:16:06.000Z | 2022-03-31T23:56:22.000Z | pages/views.py | Manny27nyc/pythondotorg | 257c96d3a94755451a5a5cdcd2abad1e27ea299b | [
"Apache-2.0"
] | 1,342 | 2015-01-02T16:14:45.000Z | 2022-03-28T08:01:20.000Z | pages/views.py | Manny27nyc/pythondotorg | 257c96d3a94755451a5a5cdcd2abad1e27ea299b | [
"Apache-2.0"
] | 551 | 2015-01-04T02:17:31.000Z | 2022-03-23T11:59:25.000Z | import re
from django.http import HttpResponsePermanentRedirect
from django.urls import reverse
from django.views.generic import DetailView
from downloads.models import Release
from .models import Page
class PageView(DetailView):
template_name = 'pages/default.html'
template_name_field = 'template_name'
... | 32.772727 | 81 | 0.607952 | import re
from django.http import HttpResponsePermanentRedirect
from django.urls import reverse
from django.views.generic import DetailView
from downloads.models import Release
from .models import Page
class PageView(DetailView):
template_name = 'pages/default.html'
template_name_field = 'template_name'
... | true | true |
f7fabe70cfd106d437b61b034e291f1d10d4b11c | 2,738 | py | Python | tests/test_pypi_api.py | yeraydiazdiaz/pypimod | e456bc30f8c4d21158b80bd46eadd853e420aea6 | [
"Apache-2.0"
] | 2 | 2019-10-06T21:40:08.000Z | 2019-10-07T00:18:03.000Z | tests/test_pypi_api.py | yeraydiazdiaz/pypimod | e456bc30f8c4d21158b80bd46eadd853e420aea6 | [
"Apache-2.0"
] | 8 | 2019-10-26T16:12:04.000Z | 2021-12-13T20:27:11.000Z | tests/test_pypi_api.py | yeraydiazdiaz/pypimod | e456bc30f8c4d21158b80bd46eadd853e420aea6 | [
"Apache-2.0"
] | null | null | null | from copy import deepcopy
import httpx
import pendulum
import pytest
from pypimod.sources import pypi_api
from pypimod import exceptions
@pytest.mark.asyncio
async def test_pypi_api(mocker, pypi_api_httpx):
mock_response = mocker.Mock(spec=httpx.Response)
mock_response.json.return_value = pypi_api_httpx
... | 35.558442 | 84 | 0.741052 | from copy import deepcopy
import httpx
import pendulum
import pytest
from pypimod.sources import pypi_api
from pypimod import exceptions
@pytest.mark.asyncio
async def test_pypi_api(mocker, pypi_api_httpx):
mock_response = mocker.Mock(spec=httpx.Response)
mock_response.json.return_value = pypi_api_httpx
... | true | true |
f7fabfe16e9c9e7dede5970aa44ab235d080576c | 26,402 | py | Python | tests/test_omegacn7500.py | alextingle/minimalmodbus | 2b78659bca938b4d07cb503413bcbe1354aa47b7 | [
"Apache-2.0"
] | null | null | null | tests/test_omegacn7500.py | alextingle/minimalmodbus | 2b78659bca938b4d07cb503413bcbe1354aa47b7 | [
"Apache-2.0"
] | null | null | null | tests/test_omegacn7500.py | alextingle/minimalmodbus | 2b78659bca938b4d07cb503413bcbe1354aa47b7 | [
"Apache-2.0"
] | 2 | 2017-01-04T22:44:03.000Z | 2019-07-03T15:07:00.000Z | #!/usr/bin/env python
#
# Copyright 2011 Jonas Berg
#
# 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... | 44.076795 | 124 | 0.668737 |
__author__ = "Jonas Berg"
__email__ = "pyhys@users.sourceforge.net"
__license__ = "Apache License, Version 2.0"
import sys
import unittest
import omegacn7500
import dummy_serial
class TestCalculateRegisterAddress(unittest.TestCase):
knownValues=[
('setpoint', 0, 0, 8192),
... | true | true |
f7fac057c699f63feb8acfcc093bdf7c8a6fa06a | 59,734 | py | Python | packages/python/plotly/plotly/graph_objs/scatterternary/_marker.py | benlindsay/plotly.py | 51ec6cb50d537a37da704ca74c07f11b62730110 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/scatterternary/_marker.py | benlindsay/plotly.py | 51ec6cb50d537a37da704ca74c07f11b62730110 | [
"MIT"
] | 1 | 2022-01-22T14:39:41.000Z | 2022-01-22T14:39:41.000Z | packages/python/plotly/plotly/graph_objs/scatterternary/_marker.py | RARedeem/plotly.py | 8289eb1c85125e147c4ce14b56272ed50b99ef20 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterternary"
_path_str = "scatterternary.marker"
_valid_props = {
"autocolorscale... | 40.60775 | 87 | 0.532461 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
_parent_path_str = "scatterternary"
_path_str = "scatterternary.marker"
_valid_props = {
"autocolorscale",
"cauto",
"cmax",
... | true | true |
f7fac07fc2e8891e9ac8eebc62220c4699a7ca4c | 17,561 | py | Python | python/aad/aad_base.py | kinect59/ad_examples | bf0bb75faa3f713a2efef04b6b093e6a313825af | [
"MIT"
] | 1 | 2019-02-21T02:28:34.000Z | 2019-02-21T02:28:34.000Z | python/aad/aad_base.py | kinect59/ad_examples | bf0bb75faa3f713a2efef04b6b093e6a313825af | [
"MIT"
] | null | null | null | python/aad/aad_base.py | kinect59/ad_examples | bf0bb75faa3f713a2efef04b6b093e6a313825af | [
"MIT"
] | null | null | null | from common.utils import *
from common.metrics import *
from common.sgd_optimization import *
from aad.aad_globals import *
from aad.query_model import *
from aad.aad_loss import *
class Ensemble(object):
"""Stores all ensemble scores"""
def __init__(self, samples, labels=None, scores=None, weights=None,
... | 37.603854 | 131 | 0.557827 | from common.utils import *
from common.metrics import *
from common.sgd_optimization import *
from aad.aad_globals import *
from aad.query_model import *
from aad.aad_loss import *
class Ensemble(object):
def __init__(self, samples, labels=None, scores=None, weights=None,
agg_scores=None, order... | true | true |
f7fac08918b6d8b252fb59487f4eac664dca1a6c | 46,878 | py | Python | data/bin/Lib/distutils/dist.py | shakenetwork/collector | 60864537f9b8046d1b42258756e36a54149dddf9 | [
"Apache-2.0"
] | 309 | 2015-05-08T18:22:55.000Z | 2022-01-11T12:27:41.000Z | data/bin/Lib/distutils/dist.py | shakenetwork/collector | 60864537f9b8046d1b42258756e36a54149dddf9 | [
"Apache-2.0"
] | 30 | 2015-05-13T02:15:15.000Z | 2019-12-28T14:01:19.000Z | data/bin/Lib/distutils/dist.py | shakenetwork/collector | 60864537f9b8046d1b42258756e36a54149dddf9 | [
"Apache-2.0"
] | 35 | 2015-06-11T05:35:55.000Z | 2022-01-11T19:32:00.000Z | """distutils.dist
Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
"""
import sys, os, re
try:
import warnings
except ImportError:
warnings = None
from distutils.errors import *
from distutils.fancy_getopt import FancyGetopt, translate_longopt
from... | 40.481865 | 82 | 0.59753 |
import sys, os, re
try:
import warnings
except ImportError:
warnings = None
from distutils.errors import *
from distutils.fancy_getopt import FancyGetopt, translate_longopt
from distutils.util import check_environ, strtobool, rfc822_escape
from distutils import log
from distutils.debug import DEBUG
# that... | true | true |
f7fac25652388c3b6a29b76286b03e7f78469ceb | 862 | py | Python | plant/database/models/compo_model.py | gerkx/big-bang-pipe | 5528d1257e18fc093d9785094732076dc46700d5 | [
"MIT"
] | null | null | null | plant/database/models/compo_model.py | gerkx/big-bang-pipe | 5528d1257e18fc093d9785094732076dc46700d5 | [
"MIT"
] | null | null | null | plant/database/models/compo_model.py | gerkx/big-bang-pipe | 5528d1257e18fc093d9785094732076dc46700d5 | [
"MIT"
] | null | null | null | from typing import Type
from nanoid import generate
from peewee import ForeignKeyField, CharField
from retrying import retry
from .base_models import VisModel
from .shot_model import Shot
class Compo(VisModel):
shot = ForeignKeyField(Shot, backref='compo')
@retry(wait_random_min=250, wait_random_max=2000, s... | 26.121212 | 81 | 0.584687 | from typing import Type
from nanoid import generate
from peewee import ForeignKeyField, CharField
from retrying import retry
from .base_models import VisModel
from .shot_model import Shot
class Compo(VisModel):
shot = ForeignKeyField(Shot, backref='compo')
@retry(wait_random_min=250, wait_random_max=2000, s... | true | true |
f7fac2bcd8dba5838de3a067e7d3ae2cfc6d745d | 4,304 | py | Python | huaweicloud-sdk-dns/huaweicloudsdkdns/v2/model/show_record_set_by_zone_response.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-dns/huaweicloudsdkdns/v2/model/show_record_set_by_zone_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-dns/huaweicloudsdkdns/v2/model/show_record_set_by_zone_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowRecordSetByZoneResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_ma... | 27.069182 | 78 | 0.580158 |
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowRecordSetByZoneResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'links': 'PageLink',
'recordsets': 'list[ShowRecordSetByZoneResp]',
'metadata': 'Metedata'
}
... | true | true |
f7fac36f1597d337dddc25e032b2678433c053e0 | 7,907 | py | Python | padim/utils/utils.py | Pangoraw/PaDiM | 76f757fd51c46abda1ced5a26c2865c6d91a8cca | [
"MIT"
] | 15 | 2021-05-27T09:06:24.000Z | 2022-03-08T06:54:09.000Z | padim/utils/utils.py | Pangoraw/PaDiM | 76f757fd51c46abda1ced5a26c2865c6d91a8cca | [
"MIT"
] | 6 | 2021-06-01T09:52:57.000Z | 2021-12-21T13:24:15.000Z | padim/utils/utils.py | Pangoraw/PaDiM | 76f757fd51c46abda1ced5a26c2865c6d91a8cca | [
"MIT"
] | 3 | 2021-05-27T13:35:29.000Z | 2021-12-14T05:06:06.000Z | """
Utils module
The code from this file comes from:
* https://github.com/taikiinoue45/PaDiM
"""
from typing import List
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from mpl_toolkits.axes_grid1 import ImageGrid
from numpy import ndarray as NDArray
from skimage import measure
from sklear... | 35.142222 | 95 | 0.614772 | from typing import List
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from mpl_toolkits.axes_grid1 import ImageGrid
from numpy import ndarray as NDArray
from skimage import measure
from sklearn.metrics import auc, roc_auc_score, roc_curve
from tqdm import tqdm
import torch
from torch import T... | true | true |
f7fac379b2652b938dad0dd8689fdf9e95e06da8 | 5,192 | py | Python | Scripts/read_HadCRUT.py | zmlabe/predictGMSTrate | 2bde4a106de1988d772f15a52d283d23bb7128f4 | [
"MIT"
] | 2 | 2022-01-20T20:20:04.000Z | 2022-02-21T12:33:37.000Z | Scripts/read_HadCRUT.py | zmlabe/predictGMSTrate | 2bde4a106de1988d772f15a52d283d23bb7128f4 | [
"MIT"
] | null | null | null | Scripts/read_HadCRUT.py | zmlabe/predictGMSTrate | 2bde4a106de1988d772f15a52d283d23bb7128f4 | [
"MIT"
] | 3 | 2022-01-19T16:25:37.000Z | 2022-03-22T13:25:00.000Z | """
Function reads in monthly data from HadCRUTv4
Notes
-----
Author : Zachary Labe
Date : 10 January 2022
Usage
-----
[1] read_HadCRUT(directory,sliceperiod,sliceyear,
sliceshape,addclimo,slicenan)
"""
def read_HadCRUT(directory,sliceperiod,sliceyear,sliceshape,addclimo,slicenan... | 34.613333 | 90 | 0.543721 |
def read_HadCRUT(directory,sliceperiod,sliceyear,sliceshape,addclimo,slicenan):
print('\n>>>>>>>>>> STARTING read_HadCRUT function!')
netCDF4 import Dataset
import warnings
import calc_Utilities as UT
warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.simplefilter(acti... | true | true |
f7fac37d4c22be12ddd99033a7ea27c603cf062d | 21,688 | py | Python | stl/signals/signal.py | pieter-hendriks/STL-monitoring | 114b73b1f4b0687b11b8842b3c4a1c8af7b0d9df | [
"MIT"
] | null | null | null | stl/signals/signal.py | pieter-hendriks/STL-monitoring | 114b73b1f4b0687b11b8842b3c4a1c8af7b0d9df | [
"MIT"
] | null | null | null | stl/signals/signal.py | pieter-hendriks/STL-monitoring | 114b73b1f4b0687b11b8842b3c4a1c8af7b0d9df | [
"MIT"
] | null | null | null | """ Implementation of a list of signals; contains some QoL methods for reading from files """
from typing import List, Tuple, Iterable
import warnings
import math
from sortedcontainers import SortedList
from .signalvalue import SignalValue
from ..utility import Interval, LineSegment, Point
def sortedListKeyFunction(x... | 46.144681 | 120 | 0.729897 | from typing import List, Tuple, Iterable
import warnings
import math
from sortedcontainers import SortedList
from .signalvalue import SignalValue
from ..utility import Interval, LineSegment, Point
def sortedListKeyFunction(x: SignalValue):
return x.getTime()
class Signal:
def __init__(
self, name: str = No... | true | true |
f7fac57e485bfb4af3770b8aeac5249a26e089ce | 8,089 | py | Python | test/functional/wallet_createwallet.py | shamimiceewu025/glee | aa0dc8240f2552e4c64a0b722d4e5f25dd981e66 | [
"MIT"
] | null | null | null | test/functional/wallet_createwallet.py | shamimiceewu025/glee | aa0dc8240f2552e4c64a0b722d4e5f25dd981e66 | [
"MIT"
] | null | null | null | test/functional/wallet_createwallet.py | shamimiceewu025/glee | aa0dc8240f2552e4c64a0b722d4e5f25dd981e66 | [
"MIT"
] | 1 | 2020-11-04T07:04:44.000Z | 2020-11-04T07:04:44.000Z | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The GleecBTC Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test createwallet arguments.
"""
from test_framework.test_framework import GleecBTCTestFramework
from... | 59.477941 | 303 | 0.705279 |
from test_framework.test_framework import GleecBTCTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
class CreateWalletTest(GleecBTCTestFramework):
def set_test_params(self):
self.setup_clean_chain = False
self.num_nodes = 1
self.supports_c... | true | true |
f7fac6b23303f4215f37a02078c4db29fd5ce8ad | 576 | py | Python | setup.py | nathanolszowski/tmtt_project | 40792e84d2fbfc7ef3d1e5013ed41f0b77089219 | [
"MIT"
] | null | null | null | setup.py | nathanolszowski/tmtt_project | 40792e84d2fbfc7ef3d1e5013ed41f0b77089219 | [
"MIT"
] | null | null | null | setup.py | nathanolszowski/tmtt_project | 40792e84d2fbfc7ef3d1e5013ed41f0b77089219 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Setup file for ttmt_project.
Use setup.cfg to configure your project.
This file was generated with PyScaffold 3.2.3.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
import sys
from pkg_resources impor... | 24 | 75 | 0.704861 |
import sys
from pkg_resources import VersionConflict, require
from setuptools import setup
try:
require('setuptools>=38.3')
except VersionConflict:
print("Error: version of setuptools is too old (<38.3)!")
sys.exit(1)
if __name__ == "__main__":
setup(use_pyscaffold=True)
| true | true |
f7fac728ab33fb4a4a27b61750e57b08d33aeb77 | 270 | py | Python | sentipy/__init__.py | sentimentinvestor/sentipy | 26611d1473f4dd7c7003767ddbed343799c6e0b7 | [
"MIT"
] | 8 | 2021-05-31T08:39:29.000Z | 2021-08-01T00:32:51.000Z | sentipy/__init__.py | sentimentinvestor/sentipy | 26611d1473f4dd7c7003767ddbed343799c6e0b7 | [
"MIT"
] | 8 | 2021-06-03T11:39:16.000Z | 2021-11-24T18:31:44.000Z | sentipy/__init__.py | sentimentinvestor/sentipy | 26611d1473f4dd7c7003767ddbed343799c6e0b7 | [
"MIT"
] | 2 | 2021-07-19T22:32:30.000Z | 2021-07-21T14:42:35.000Z | """The Sentipy module provides a simple and lightweight way to interact with the SentimentInvestor API and data.
For more information, please visit https://docs.sentimentinvestor.com/python/
"""
from . import sentipy
__all__ = ["sentipy", "ws"]
__version__ = "1.1.0"
| 27 | 112 | 0.751852 |
from . import sentipy
__all__ = ["sentipy", "ws"]
__version__ = "1.1.0"
| true | true |
f7fac7af6ebd7e3f44e8212adff1f4c0476eeeec | 11,042 | py | Python | importers/issue_tracker/github/querier_github.py | SOM-Research/Gitana | 95babc437d0a418ba8cbf89fe516cc599bc4e880 | [
"MIT"
] | 63 | 2015-05-12T09:13:34.000Z | 2021-09-29T07:24:51.000Z | importers/issue_tracker/github/querier_github.py | atlanmod/Gitana | 95babc437d0a418ba8cbf89fe516cc599bc4e880 | [
"MIT"
] | 29 | 2015-11-26T09:55:34.000Z | 2021-10-21T10:32:52.000Z | importers/issue_tracker/github/querier_github.py | atlanmod/Gitana | 95babc437d0a418ba8cbf89fe516cc599bc4e880 | [
"MIT"
] | 20 | 2016-09-12T15:22:28.000Z | 2021-08-07T23:06:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'valerio cosentino'
from github import Github
from util.date_util import DateUtil
from util.token_util import TokenUtil
import re
class GitHubQuerier():
"""
This class collects the data available on the GitHub issue tracker via its API
"""
d... | 26.86618 | 113 | 0.573537 |
__author__ = 'valerio cosentino'
from github import Github
from util.date_util import DateUtil
from util.token_util import TokenUtil
import re
class GitHubQuerier():
def __init__(self, url, token, logger):
try:
self._logger = logger
self._url = url
self._token = tok... | true | true |
f7fac7dd5bc34ca32f679bf0e5658333b563103a | 980 | py | Python | src/conduit/scripts/drop_tables.py | Infinisil/pyramid-realworld-example-app | edd3ed1f89fb9d38c3d524ed1978ded61d56d7dd | [
"MIT"
] | null | null | null | src/conduit/scripts/drop_tables.py | Infinisil/pyramid-realworld-example-app | edd3ed1f89fb9d38c3d524ed1978ded61d56d7dd | [
"MIT"
] | null | null | null | src/conduit/scripts/drop_tables.py | Infinisil/pyramid-realworld-example-app | edd3ed1f89fb9d38c3d524ed1978ded61d56d7dd | [
"MIT"
] | null | null | null | """Drop database content."""
from pyramid.paster import bootstrap
from pyramid.paster import setup_logging
import argparse
import structlog
import sys
import typing as t
logger = structlog.getLogger("db")
def main(argv: t.List[str] = sys.argv) -> None:
"""Run the script."""
parser = argparse.ArgumentParse... | 23.333333 | 78 | 0.652041 |
from pyramid.paster import bootstrap
from pyramid.paster import setup_logging
import argparse
import structlog
import sys
import typing as t
logger = structlog.getLogger("db")
def main(argv: t.List[str] = sys.argv) -> None:
parser = argparse.ArgumentParser(
usage="pipenv run python -m conduit.scripts.... | true | true |
f7fac89ab018d9a3a63c67bd13cca445f5cfab79 | 2,172 | py | Python | test/lazy/test_chol_lazy_tensor.py | lrast/gpytorch | 2e0bbc9f59e4b4b54780c3e55db784c3d2c9a5bf | [
"MIT"
] | 2 | 2021-01-30T18:24:18.000Z | 2021-02-16T21:54:11.000Z | test/lazy/test_chol_lazy_tensor.py | lrast/gpytorch | 2e0bbc9f59e4b4b54780c3e55db784c3d2c9a5bf | [
"MIT"
] | null | null | null | test/lazy/test_chol_lazy_tensor.py | lrast/gpytorch | 2e0bbc9f59e4b4b54780c3e55db784c3d2c9a5bf | [
"MIT"
] | 1 | 2021-03-15T12:32:24.000Z | 2021-03-15T12:32:24.000Z | #!/usr/bin/env python3
import unittest
import torch
from gpytorch.lazy import CholLazyTensor, TriangularLazyTensor
from gpytorch.test.lazy_tensor_test_case import LazyTensorTestCase
class TestCholLazyTensor(LazyTensorTestCase, unittest.TestCase):
seed = 0
should_test_sample = True
should_call_cg = Fals... | 31.028571 | 107 | 0.547422 |
import unittest
import torch
from gpytorch.lazy import CholLazyTensor, TriangularLazyTensor
from gpytorch.test.lazy_tensor_test_case import LazyTensorTestCase
class TestCholLazyTensor(LazyTensorTestCase, unittest.TestCase):
seed = 0
should_test_sample = True
should_call_cg = False
should_call_lanc... | true | true |
f7fac9958697852b1d8e9d0b2458b6c59e50eb16 | 859 | py | Python | setup.py | rwnx/bunnyplot | 31f4824d683f6fb835fc3caafa58884a2f7e4730 | [
"MIT"
] | 1 | 2021-05-03T00:35:19.000Z | 2021-05-03T00:35:19.000Z | setup.py | rwnx/bunnyplot | 31f4824d683f6fb835fc3caafa58884a2f7e4730 | [
"MIT"
] | null | null | null | setup.py | rwnx/bunnyplot | 31f4824d683f6fb835fc3caafa58884a2f7e4730 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="bunnyplot",
version="0.1.0",
author="Jerome Twell",
author_email="jtwell1@gmail.com",
description="A utility for producting GraphML from RabbitMQ",
long_description=long_description,
... | 27.709677 | 65 | 0.63213 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="bunnyplot",
version="0.1.0",
author="Jerome Twell",
author_email="jtwell1@gmail.com",
description="A utility for producting GraphML from RabbitMQ",
long_description=long_description,
... | true | true |
f7fac9b1d7d6d8bce4f93173226df89c63b5fe81 | 808 | py | Python | PYwithD2L/CH3/3.3.py | JunoCheon/D2L | 9464709862e55151aec28fc637c5942738bdd72b | [
"MIT"
] | null | null | null | PYwithD2L/CH3/3.3.py | JunoCheon/D2L | 9464709862e55151aec28fc637c5942738bdd72b | [
"MIT"
] | null | null | null | PYwithD2L/CH3/3.3.py | JunoCheon/D2L | 9464709862e55151aec28fc637c5942738bdd72b | [
"MIT"
] | null | null | null | #%%
import numpy as np
import torch
from torch.utils import data
from d2l import torch as d2l
npx.np_set()
# %%
true_w = torch.tensor([2,-3.4])
true_b = 4.2
features, labels = d2l.synthetic_data(true_w,true_b,1000)
#%%
def load_array(data_array,batch_size,is_train = True):
dataset = data.TensorDataset(*data_array... | 18.790698 | 63 | 0.711634 |
import numpy as np
import torch
from torch.utils import data
from d2l import torch as d2l
npx.np_set()
true_w = torch.tensor([2,-3.4])
true_b = 4.2
features, labels = d2l.synthetic_data(true_w,true_b,1000)
def load_array(data_array,batch_size,is_train = True):
dataset = data.TensorDataset(*data_array)
retu... | false | true |
f7facb048440fd2b4a675f9781262771dd21f789 | 2,058 | py | Python | neutron/db/migration/alembic_migrations/versions/mitaka/expand/15e43b934f81_rbac_qos_policy.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 1 | 2017-09-10T09:57:35.000Z | 2017-09-10T09:57:35.000Z | neutron/db/migration/alembic_migrations/versions/mitaka/expand/15e43b934f81_rbac_qos_policy.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-27T00:48:55.000Z | 2015-04-21T05:29:37.000Z | neutron/db/migration/alembic_migrations/versions/mitaka/expand/15e43b934f81_rbac_qos_policy.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-26T00:55:17.000Z | 2020-03-01T17:05:40.000Z | # Copyright 2015 OpenStack Foundation
#
# 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 ... | 38.111111 | 79 | 0.582119 |
from alembic import op
import sqlalchemy as sa
from neutron.api.v2 import attributes as attrs
revision = '15e43b934f81'
down_revision = 'b4caf27aae4'
def upgrade():
op.create_table('qospolicyrbacs',
sa.Column('id', sa.String(length=36), nullable=False),
s... | true | true |
f7facb17edfef659254f8e603b3ce318866043e1 | 665 | py | Python | structures/tests/bar_test.py | EladSharony/Mechanics | 078f97bea84114fc1db6fe9700b92b96b18a0d5e | [
"MIT"
] | 24 | 2021-02-23T13:53:14.000Z | 2022-03-29T16:40:56.000Z | structures/tests/bar_test.py | EladSharony/Mechanics | 078f97bea84114fc1db6fe9700b92b96b18a0d5e | [
"MIT"
] | 2 | 2021-04-23T12:30:32.000Z | 2022-03-31T10:51:12.000Z | structures/tests/bar_test.py | EladSharony/Mechanics | 078f97bea84114fc1db6fe9700b92b96b18a0d5e | [
"MIT"
] | 12 | 2021-04-11T20:44:03.000Z | 2022-03-30T19:23:58.000Z | import unittest
from math import sqrt
from eqs import Matrix
from geom2d import Point
from structures.model.node import StrNode
from structures.model.bar import StrBar
class BarTest(unittest.TestCase):
section = sqrt(5)
young = 5
node_a = StrNode(1, Point(0, 0))
node_b = StrNode(2, Point(2, 1))
... | 24.62963 | 51 | 0.607519 | import unittest
from math import sqrt
from eqs import Matrix
from geom2d import Point
from structures.model.node import StrNode
from structures.model.bar import StrBar
class BarTest(unittest.TestCase):
section = sqrt(5)
young = 5
node_a = StrNode(1, Point(0, 0))
node_b = StrNode(2, Point(2, 1))
... | true | true |
f7facb63ac47f2e72439c2d03848e271ece3fd30 | 4,072 | py | Python | product_search/settings.py | yanglinz/product-search | ad2c5d372944526dd2c6fe4888eb8920e39e2d26 | [
"MIT"
] | 1 | 2018-08-23T19:58:03.000Z | 2018-08-23T19:58:03.000Z | product_search/settings.py | yanglinz/product-search | ad2c5d372944526dd2c6fe4888eb8920e39e2d26 | [
"MIT"
] | 10 | 2020-09-06T01:28:36.000Z | 2022-03-03T22:41:59.000Z | product_search/settings.py | yanglinz/product-search | ad2c5d372944526dd2c6fe4888eb8920e39e2d26 | [
"MIT"
] | null | null | null | import os
import dj_database_url
import django_heroku
import dotenv
dotenv.read_dotenv()
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
# Quick-start development... | 30.162963 | 90 | 0.726424 | import os
import dj_database_url
import django_heroku
import dotenv
dotenv.read_dotenv()
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = os.environ["SECRET_KEY"]
DEBUG = os.environ["DEBUG"] == "true"
INSTALLED_APPS... | true | true |
f7facb852a3db388a7c69659114114ea83276164 | 12,295 | py | Python | tensorflow_probability/python/experimental/mcmc/sample_fold.py | rupei/probability | 4aa1ee652853a19c4e80d39216c3fa535ed3e589 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/experimental/mcmc/sample_fold.py | rupei/probability | 4aa1ee652853a19c4e80d39216c3fa535ed3e589 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/experimental/mcmc/sample_fold.py | rupei/probability | 4aa1ee652853a19c4e80d39216c3fa535ed3e589 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Probability Authors.
#
# 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... | 43.140351 | 85 | 0.727938 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.experimental.mcmc import sample as exp_sample_lib
from tensorflow_probability.python.experimental.mcmc impor... | true | true |
f7facbc5938a85e2fb02aa28d1a3a30d130325b1 | 428 | py | Python | web crawler functions/crawl_web_dict.py | akshaynagpal/python_web_crawler | a74af25db4c9f819105621868a6a9a7337a2a770 | [
"MIT"
] | 1 | 2022-03-06T21:00:45.000Z | 2022-03-06T21:00:45.000Z | web crawler functions/crawl_web_dict.py | akshaynagpal/python_web_crawler | a74af25db4c9f819105621868a6a9a7337a2a770 | [
"MIT"
] | null | null | null | web crawler functions/crawl_web_dict.py | akshaynagpal/python_web_crawler | a74af25db4c9f819105621868a6a9a7337a2a770 | [
"MIT"
] | null | null | null | def union(p,q):
for e in q:
if e not in p:
p.append(e)
def crawl_web(seed):
tocrawl = [seed]
crawled = []
index = {}
graph = {}
while tocrawl:
page = tocrawl.pop()
if page not in crawled:
content = get_page(page)
add_page_to_index(index,page,content)
outlinks = get_all_links... | 19.454545 | 40 | 0.635514 | def union(p,q):
for e in q:
if e not in p:
p.append(e)
def crawl_web(seed):
tocrawl = [seed]
crawled = []
index = {}
graph = {}
while tocrawl:
page = tocrawl.pop()
if page not in crawled:
content = get_page(page)
add_page_to_index(index,page,content)
outlinks = get_all_links... | true | true |
f7facc8714f2358ff5e4f5bf725d3516243bec69 | 10,025 | py | Python | algos/custom_ppo2.py | Ottawa-Autonomous-Vehicle-Group/learning-to-drive-in-5-minutes | fb82bc77593605711289e03f95dcfb6d3ea9e6c3 | [
"MIT"
] | 1 | 2020-08-02T20:47:44.000Z | 2020-08-02T20:47:44.000Z | algos/custom_ppo2.py | vijpandaturtle/learning-to-drive-in-5-minutes | fb82bc77593605711289e03f95dcfb6d3ea9e6c3 | [
"MIT"
] | null | null | null | algos/custom_ppo2.py | vijpandaturtle/learning-to-drive-in-5-minutes | fb82bc77593605711289e03f95dcfb6d3ea9e6c3 | [
"MIT"
] | null | null | null | import time
from collections import deque
import gym
import numpy as np
from stable_baselines import logger, PPO2
from stable_baselines.a2c.utils import total_episode_reward_logger
from stable_baselines.common import explained_variance, TensorboardWriter
from stable_baselines.common.runners import AbstractEnvRunner
fr... | 52.213542 | 121 | 0.572569 | import time
from collections import deque
import gym
import numpy as np
from stable_baselines import logger, PPO2
from stable_baselines.a2c.utils import total_episode_reward_logger
from stable_baselines.common import explained_variance, TensorboardWriter
from stable_baselines.common.runners import AbstractEnvRunner
fr... | true | true |
f7face466b52b16e22558c4da96f32c9df411036 | 579 | py | Python | webware/MiddleKit/Properties.py | PeaceWorksTechnologySolutions/w4py3-middlekit | a9554e20c47010e7b0c0deee63e1786482c59a1c | [
"MIT"
] | 2 | 2020-10-31T09:12:58.000Z | 2021-02-20T13:52:14.000Z | webware/MiddleKit/Properties.py | WebwareForPython/w4py3-middlekit | f740e2d2d3a5c225d6b8f9eb27ac08f8deed47e6 | [
"MIT"
] | 2 | 2020-01-07T15:24:09.000Z | 2020-01-08T15:39:57.000Z | webware/MiddleKit/Properties.py | PeaceWorksTechnologySolutions/w4py3-middlekit | a9554e20c47010e7b0c0deee63e1786482c59a1c | [
"MIT"
] | 1 | 2021-09-27T21:04:18.000Z | 2021-09-27T21:04:18.000Z | name = 'MiddleKit'
version = (3, 0, 0, 'a1')
docs = [
{'name': 'Introduction', 'file': 'Intro.html'},
{'name': 'Quick Start', 'file': 'QuickStart.html'},
{'name': "User's Guide", 'file': 'UsersGuide.html'},
{'name': 'To Do', 'file': 'TODO.text'},
]
status = 'pre-release'
requiredPyVersion = (3, 6, 0... | 34.058824 | 255 | 0.656304 | name = 'MiddleKit'
version = (3, 0, 0, 'a1')
docs = [
{'name': 'Introduction', 'file': 'Intro.html'},
{'name': 'Quick Start', 'file': 'QuickStart.html'},
{'name': "User's Guide", 'file': 'UsersGuide.html'},
{'name': 'To Do', 'file': 'TODO.text'},
]
status = 'pre-release'
requiredPyVersion = (3, 6, 0... | true | true |
f7facf6279f52b345e048fabfe93b7628ef0dd0f | 27,027 | py | Python | steinerpy/library/search/generic_algorithms.py | Kchour/steinerpy | be6206533b7b28cfb67800ee847f0de367dab834 | [
"MIT"
] | 3 | 2021-06-10T16:46:20.000Z | 2022-02-11T14:24:15.000Z | steinerpy/library/search/generic_algorithms.py | Kchour/steinerpy | be6206533b7b28cfb67800ee847f0de367dab834 | [
"MIT"
] | 12 | 2021-03-31T03:31:24.000Z | 2021-11-18T21:51:18.000Z | steinerpy/library/search/generic_algorithms.py | Kchour/steinerpy | be6206533b7b28cfb67800ee847f0de367dab834 | [
"MIT"
] | 1 | 2021-06-13T15:01:24.000Z | 2021-06-13T15:01:24.000Z | """This module provides a generic incremental search class, that breaks up nomination and update phase"""
import matplotlib.pyplot as plt
import numpy as np
from timeit import default_timer as timer
import steinerpy.config as cfg
from steinerpy.library.animation import AnimateV2
from steinerpy.library.logger import... | 38.72063 | 152 | 0.564917 |
import matplotlib.pyplot as plt
import numpy as np
from timeit import default_timer as timer
import steinerpy.config as cfg
from steinerpy.library.animation import AnimateV2
from steinerpy.library.logger import MyLogger
from steinerpy.library.misc.utils import MyTimer
from steinerpy.library.search.search_utils impo... | true | true |
f7facf8ff238e891071ee8086fe2a9503f5fa45b | 407 | py | Python | attr_and_methods/topics/topic.py | borko81/SU_OOP_2021 | 8c38682bd4a2b032ca09f85b0a579be152223a59 | [
"MIT"
] | null | null | null | attr_and_methods/topics/topic.py | borko81/SU_OOP_2021 | 8c38682bd4a2b032ca09f85b0a579be152223a59 | [
"MIT"
] | null | null | null | attr_and_methods/topics/topic.py | borko81/SU_OOP_2021 | 8c38682bd4a2b032ca09f85b0a579be152223a59 | [
"MIT"
] | null | null | null | class Topic:
def __init__(self, id: int, topic: str, storage_folder: str):
self.id = id
self.topic = topic
self.storage_folder = storage_folder
def edit(self, new_topic, new_storage_folder):
self.topic = new_topic
self.storage_folder = new_storage_folder
def __repr_... | 33.916667 | 72 | 0.653563 | class Topic:
def __init__(self, id: int, topic: str, storage_folder: str):
self.id = id
self.topic = topic
self.storage_folder = storage_folder
def edit(self, new_topic, new_storage_folder):
self.topic = new_topic
self.storage_folder = new_storage_folder
def __repr_... | true | true |
f7fad01f0aa06487ca6bf418a103cee17ac8b369 | 751 | py | Python | subsampler.py | Puraneshi/pocket2vec | bb6f00f8e218ba032d8a802ac0a2900720227202 | [
"MIT"
] | 1 | 2019-04-24T16:32:53.000Z | 2019-04-24T16:32:53.000Z | subsampler.py | Puraneshi/pocket2vec | bb6f00f8e218ba032d8a802ac0a2900720227202 | [
"MIT"
] | null | null | null | subsampler.py | Puraneshi/pocket2vec | bb6f00f8e218ba032d8a802ac0a2900720227202 | [
"MIT"
] | null | null | null | def multiIter(lista, n):
'''
:param lista: a list of strings
:param n: how many objects will return
before and after any element
:return: 'context' is a tuple of the element plus its n-neighbors AND the element index
'''
for i in range(len(lista)):
context = [... | 31.291667 | 92 | 0.48735 | def multiIter(lista, n):
for i in range(len(lista)):
context = []
before = n
index = 0
while before:
if i - before >= 0:
context.append(lista[i-before])
index += 1
before -= 1
context.append(lista[i])
... | true | true |
f7fad116fc0a57afb735c4ff40fbccc6103fac17 | 12,931 | py | Python | RobustGaussianFittingLibrary/cWrapper.py | ARSadri/RobustGaussianFittingLibrary | e8f273f0fb363f3092628ff295758d45595b1f19 | [
"MIT"
] | 1 | 2021-05-31T09:35:59.000Z | 2021-05-31T09:35:59.000Z | RobustGaussianFittingLibrary/cWrapper.py | ARSadri/RobustGaussianFittingLibrary | e8f273f0fb363f3092628ff295758d45595b1f19 | [
"MIT"
] | 33 | 2020-09-22T13:05:17.000Z | 2022-01-07T09:44:18.000Z | RobustGaussianFittingLibrary/cWrapper.py | ARSadri/RobustGaussianFittingLibrary | e8f273f0fb363f3092628ff295758d45595b1f19 | [
"MIT"
] | null | null | null | """
------------------------------------------------------
This file is part of RobustGaussianFittingLibrary,
a free library WITHOUT ANY WARRANTY
Copyright: 2017-2020 LaTrobe University Melbourne,
2019-2020 Deutsches Elektronen-Synchrotron
------------------------------------------------------
"""
""" A cty... | 45.53169 | 103 | 0.603434 |
import numpy as np
import ctypes
import os
import fnmatch
dir_path = os.path.dirname(os.path.realpath(__file__)) + os.path.sep + '..' + os.path.sep
fileNameTemplate = 'RGFLib*.so'
flist = fnmatch.filter(os.listdir(dir_path + os.path.sep), fileNameTemplate)
if(len(flist)==0):
dir_path = os.path.dirname(os.path.realp... | true | true |
f7fad11a710e7aa83dd989480644e9233166a080 | 32,251 | py | Python | plexapi/myplex.py | adamredfern92/PlexDownload | 003086b8e12c47636ea9ec7785b25123812d1c7f | [
"MIT"
] | 3 | 2018-01-26T04:53:13.000Z | 2019-10-16T03:48:08.000Z | plexapi/myplex.py | adamredfern92/PlexDownload | 003086b8e12c47636ea9ec7785b25123812d1c7f | [
"MIT"
] | null | null | null | plexapi/myplex.py | adamredfern92/PlexDownload | 003086b8e12c47636ea9ec7785b25123812d1c7f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
import requests
import time
from requests.status_codes import _codes as codes
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT
from plexapi import log, logfilter, utils
from plexapi.base import PlexObject
from plexapi.exceptions import BadRequest, NotFound
from plexapi.client import... | 52.957307 | 119 | 0.632383 |
import copy
import requests
import time
from requests.status_codes import _codes as codes
from plexapi import BASE_HEADERS, CONFIG, TIMEOUT
from plexapi import log, logfilter, utils
from plexapi.base import PlexObject
from plexapi.exceptions import BadRequest, NotFound
from plexapi.client import PlexClient
from plexap... | true | true |
f7fad12e94f097d9af74b0aac3942946b1480a3d | 6,124 | py | Python | modules/encounter.py | HeercoGrond/Cha5ebot | 06ffbcd453a747b9b0d0812934bb0b3730b1ed4d | [
"Unlicense"
] | null | null | null | modules/encounter.py | HeercoGrond/Cha5ebot | 06ffbcd453a747b9b0d0812934bb0b3730b1ed4d | [
"Unlicense"
] | null | null | null | modules/encounter.py | HeercoGrond/Cha5ebot | 06ffbcd453a747b9b0d0812934bb0b3730b1ed4d | [
"Unlicense"
] | null | null | null | from discord.ext import commands
import discord
import json
import os
class Encounter(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print("loaded cog")
@commands.command()
async def encounter(self, ctx, *args... | 47.107692 | 201 | 0.475506 | from discord.ext import commands
import discord
import json
import os
class Encounter(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print("loaded cog")
@commands.command()
async def encounter(self, ctx, *args... | true | true |
f7fad15c620f7dfe7cd3ef5776c35594cf56ee75 | 4,095 | py | Python | synapse/handlers/devicemessage.py | khanof/jsynapse | 1200f28d661747a019d2f33bd5623c7bc635c59e | [
"Apache-2.0"
] | 1 | 2017-02-03T18:58:29.000Z | 2017-02-03T18:58:29.000Z | synapse/handlers/devicemessage.py | khanof/jsynapse | 1200f28d661747a019d2f33bd5623c7bc635c59e | [
"Apache-2.0"
] | null | null | null | synapse/handlers/devicemessage.py | khanof/jsynapse | 1200f28d661747a019d2f33bd5623c7bc635c59e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.70339 | 80 | 0.610501 |
import logging
from twisted.internet import defer
from synapse.types import get_domain_from_id
from synapse.util.stringutils import random_string
logger = logging.getLogger(__name__)
class DeviceMessageHandler(object):
def __init__(self, hs):
self.store = hs.get_datastore()
sel... | true | true |
f7fad1e4a4233910271caf4fcf2b4baf3b413155 | 161 | py | Python | segmentify/model/layers/identity.py | kne42/segmentify | cdacf55be64d066958d0114c0748141203708a06 | [
"BSD-3-Clause"
] | 26 | 2019-07-29T21:52:08.000Z | 2022-03-30T16:47:12.000Z | segmentify/model/layers/identity.py | joaomamede/segmentify | bd57cfcc94ad2f6dfcb080ae786f410e044659c4 | [
"BSD-3-Clause"
] | 24 | 2019-07-25T20:38:43.000Z | 2021-02-09T21:53:55.000Z | segmentify/model/layers/identity.py | joaomamede/segmentify | bd57cfcc94ad2f6dfcb080ae786f410e044659c4 | [
"BSD-3-Clause"
] | 11 | 2019-06-18T22:37:34.000Z | 2021-12-14T05:35:24.000Z | import torch.nn as nn
class Identity(nn.Module):
def __init__(self):
super(Identity, self).__init__()
def forward(self, x):
return x
| 14.636364 | 40 | 0.621118 | import torch.nn as nn
class Identity(nn.Module):
def __init__(self):
super(Identity, self).__init__()
def forward(self, x):
return x
| true | true |
f7fad1f35fca48a03bd697853e60bef374d0162b | 1,684 | py | Python | PythonClient/box.py | woxihuanwangdanling/AirsimWithVS2017 | 0e8c65bbc28cd250fb5d23d67faed5fa127fec76 | [
"MIT"
] | null | null | null | PythonClient/box.py | woxihuanwangdanling/AirsimWithVS2017 | 0e8c65bbc28cd250fb5d23d67faed5fa127fec76 | [
"MIT"
] | null | null | null | PythonClient/box.py | woxihuanwangdanling/AirsimWithVS2017 | 0e8c65bbc28cd250fb5d23d67faed5fa127fec76 | [
"MIT"
] | null | null | null | from AirSimClient import *
import sys
import time
client = MultirotorClient()
client.confirmConnection()
client.enableApiControl(True)
client.armDisarm(True)
client.takeoff()
print("Flying a small square box using moveByVelocityZ")
print("Try pressing 't' in the AirSim view to see a pink trace of the flight")
# AirS... | 35.829787 | 116 | 0.733373 | from AirSimClient import *
import sys
import time
client = MultirotorClient()
client.confirmConnection()
client.enableApiControl(True)
client.armDisarm(True)
client.takeoff()
print("Flying a small square box using moveByVelocityZ")
print("Try pressing 't' in the AirSim view to see a pink trace of the flight")
z = ... | true | true |
f7fad29beb4af51301026f0d4bde4876a538764a | 10,179 | py | Python | keystone/identity/backends/sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | keystone/identity/backends/sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | keystone/identity/backends/sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# 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... | 40.716 | 78 | 0.616858 |
import sqlalchemy
from keystone.common import driver_hints
from keystone.common import sql
from keystone.common import utils
from keystone import exception
from keystone.i18n import _
from keystone.identity.backends import base
from keystone.identity.backends import sql_model as model
class Identity(ba... | true | true |
f7fad3075f031c1ae85ab2d48d9309b41ed7b022 | 664 | py | Python | jp.atcoder/abc214/abc214_f/26740844.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc214/abc214_f/26740844.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc214/abc214_f/26740844.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
import typing
import numba as nb
import numpy as np
@nb.njit((nb.i8[:], ), cache=True)
def solve(a: np.ndarray) -> typing.NoReturn:
n = len(a)
prev = np.empty(n, np.int64)
last = np.zeros(26, np.int64)
for i in range(n):
prev[i] = last[a[i]]
last[a[i]] = i + 1... | 21.419355 | 49 | 0.472892 | import sys
import typing
import numba as nb
import numpy as np
@nb.njit((nb.i8[:], ), cache=True)
def solve(a: np.ndarray) -> typing.NoReturn:
n = len(a)
prev = np.empty(n, np.int64)
last = np.zeros(26, np.int64)
for i in range(n):
prev[i] = last[a[i]]
last[a[i]] = i + 1... | true | true |
f7fad4089fb11570038e537c7a646b7bb71bebd9 | 2,685 | py | Python | doc/source/conf.py | stackhpc/ansible-collection-kolla | b3867aa23b00906fb3844b7a63bd95d664ad8fd3 | [
"Apache-2.0"
] | 1 | 2021-11-26T20:02:11.000Z | 2021-11-26T20:02:11.000Z | doc/source/conf.py | stackhpc/ansible-collection-kolla | b3867aa23b00906fb3844b7a63bd95d664ad8fd3 | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | stackhpc/ansible-collection-kolla | b3867aa23b00906fb3844b7a63bd95d664ad8fd3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 32.743902 | 79 | 0.708752 |
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
extensions = [
'sphinx.ext.autodoc',
'openstackdocstheme',
]
source_suffix = '.rst'
master_doc = 'index'
project = u'ansible-collection-kolla'
copyright = u'2017, OpenStack Developers'
openstackdocs_repo_name =... | true | true |
f7fad45bd124cd83768da5d7e12f88133cc9938e | 5,491 | py | Python | BiblioAlly/scopus.py | gambit4348/BiblioAlly | c04ac378770a3cdcbba863799383103049df22f3 | [
"MIT"
] | null | null | null | BiblioAlly/scopus.py | gambit4348/BiblioAlly | c04ac378770a3cdcbba863799383103049df22f3 | [
"MIT"
] | null | null | null | BiblioAlly/scopus.py | gambit4348/BiblioAlly | c04ac378770a3cdcbba863799383103049df22f3 | [
"MIT"
] | null | null | null | from BiblioAlly import catalog as cat, domain, translator as bibtex
class ScopusTranslator(bibtex.Translator):
def _document_from_proto_document(self, proto_document):
bibtex.Translator._translate_kind(proto_document)
kind = proto_document['type']
fields = proto_document['field']
... | 43.928 | 117 | 0.616463 | from BiblioAlly import catalog as cat, domain, translator as bibtex
class ScopusTranslator(bibtex.Translator):
def _document_from_proto_document(self, proto_document):
bibtex.Translator._translate_kind(proto_document)
kind = proto_document['type']
fields = proto_document['field']
... | true | true |
f7fad4b64a6a34a94a5f9892021ec5f63805fd14 | 21,740 | py | Python | src/vpoller/worker.py | nikypint/py-vpoller | c7657dfc73831adf03c88363dee51c545ff8d511 | [
"BSD-2-Clause"
] | null | null | null | src/vpoller/worker.py | nikypint/py-vpoller | c7657dfc73831adf03c88363dee51c545ff8d511 | [
"BSD-2-Clause"
] | null | null | null | src/vpoller/worker.py | nikypint/py-vpoller | c7657dfc73831adf03c88363dee51c545ff8d511 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2013-2015 Marin Atanasov Nikolov <dnaeon@gmail.com>
# All rights reserved.
#
# 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
# notic... | 31.598837 | 89 | 0.56058 |
import json
import importlib
import multiprocessing
from platform import node
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
import zmq
import pyVmomi
from vpoller import __version__
from vpoller.log import logger
from vpoller.cl... | true | true |
f7fad4fa00de69e0ff28ba2e26f9f2d1185db522 | 730 | py | Python | tests/embedding/clustering/test_kmeans.py | microsoft/topologic | d3a2155a42469ccb16de178f47bec81b0476fdc8 | [
"MIT"
] | 24 | 2020-02-10T23:51:06.000Z | 2021-11-17T02:34:47.000Z | tests/embedding/clustering/test_kmeans.py | microsoft/topologic | d3a2155a42469ccb16de178f47bec81b0476fdc8 | [
"MIT"
] | 26 | 2020-02-11T18:37:33.000Z | 2020-11-11T00:14:41.000Z | tests/embedding/clustering/test_kmeans.py | microsoft/topologic | d3a2155a42469ccb16de178f47bec81b0476fdc8 | [
"MIT"
] | 6 | 2020-07-31T11:05:36.000Z | 2021-11-10T08:18:52.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import topologic.embedding.clustering as tc_embedding_clustering
import numpy as np
import unittest
from tests.utils import data_file
class TestKmeans(unittest.TestCase):
def test_kmeans_returns_correctly_shaped_labels(self):
matrix... | 31.73913 | 90 | 0.643836 |
import topologic.embedding.clustering as tc_embedding_clustering
import numpy as np
import unittest
from tests.utils import data_file
class TestKmeans(unittest.TestCase):
def test_kmeans_returns_correctly_shaped_labels(self):
matrix = np.loadtxt(data_file('gmm-input.csv'), delimiter=',', usecols=range(... | true | true |
f7fad566236054ea2dbbc89c4beeaf2f0a5a0d71 | 32,766 | py | Python | faster_rcnn/core/loader.py | whywhs/Detection_and_Recognition_in_Remote_Sensing_Image | 201c7450ad45d203b59d8345fb6fad903fad8748 | [
"Apache-2.0"
] | 20 | 2019-02-13T12:14:19.000Z | 2022-03-30T07:14:50.000Z | faster_rcnn/core/loader.py | whywhs/Detection_and_Recognition_in_Remote_Sensing_Image | 201c7450ad45d203b59d8345fb6fad903fad8748 | [
"Apache-2.0"
] | 1 | 2019-05-15T01:53:52.000Z | 2019-05-15T06:27:15.000Z | faster_rcnn/core/loader.py | whywhs/Detection_and_Recognition_in_Remote_Sensing_Image | 201c7450ad45d203b59d8345fb6fad903fad8748 | [
"Apache-2.0"
] | 12 | 2019-05-13T09:42:00.000Z | 2021-08-03T02:25:32.000Z | # --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2016 by Contributors
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Modified by Yuwen Xiong
# --------------------------------------------------------
impor... | 38.822275 | 149 | 0.596441 |
import numpy as np
import mxnet as mx
from mxnet.executor_manager import _split_input_slice
from config.config import config
from utils.image import tensor_vstack
from rpn.rpn import get_rpn_testbatch, get_rpn_batch, assign_anchor, get_rpn_batch_quadrangle, assign_quadrangle_anchor, get_rpn_quadrangle_testbatc... | true | true |
f7fad649e27092449b3feae00984eb3561b8597a | 283 | py | Python | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}_api/api/__init__.py | frank2411/cookiecutter_flasktemplate | fc80827f0f7e7b87679790c8c1d9094518576b5b | [
"Apache-2.0"
] | null | null | null | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}_api/api/__init__.py | frank2411/cookiecutter_flasktemplate | fc80827f0f7e7b87679790c8c1d9094518576b5b | [
"Apache-2.0"
] | null | null | null | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}_api/api/__init__.py | frank2411/cookiecutter_flasktemplate | fc80827f0f7e7b87679790c8c1d9094518576b5b | [
"Apache-2.0"
] | null | null | null | from flask import Blueprint
from flask_restful import Api
from .resources import SwaggerView
api_blueprint = Blueprint('api', __name__, url_prefix='/api/{{cookiecutter.api_version}}')
api = Api(api_blueprint)
# Swagger API
api.add_resource(SwaggerView, '/docs', methods=["GET"])
| 23.583333 | 90 | 0.770318 | from flask import Blueprint
from flask_restful import Api
from .resources import SwaggerView
api_blueprint = Blueprint('api', __name__, url_prefix='/api/{{cookiecutter.api_version}}')
api = Api(api_blueprint)
api.add_resource(SwaggerView, '/docs', methods=["GET"])
| true | true |
f7fad6556d64ec85bca1397236a73ab277feeba2 | 13,102 | py | Python | sdk/lusid/models/instrument.py | fossabot/lusid-sdk-python | 154a0232a00026d79379aec7196555f24d742ade | [
"MIT"
] | null | null | null | sdk/lusid/models/instrument.py | fossabot/lusid-sdk-python | 154a0232a00026d79379aec7196555f24d742ade | [
"MIT"
] | null | null | null | sdk/lusid/models/instrument.py | fossabot/lusid-sdk-python | 154a0232a00026d79379aec7196555f24d742ade | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.2321
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class Instrument(object):
"""NOTE: This class is au... | 32.270936 | 214 | 0.612884 |
import pprint
import re
import six
class Instrument(object):
openapi_types = {
'href': 'str',
'lusid_instrument_id': 'str',
'version': 'Version',
'name': 'str',
'identifiers': 'dict(str, str)',
'properties': 'list[ModelProperty]',
'lookthrough_portfol... | true | true |
f7fad6aafda698b3400a9a1a2a99c7a01ffa8e7a | 5,657 | py | Python | cf_xarray/helpers.py | dcherian/cf-xarray | c881164fd308c98b5b22426c2164539b36c307b3 | [
"Apache-2.0"
] | null | null | null | cf_xarray/helpers.py | dcherian/cf-xarray | c881164fd308c98b5b22426c2164539b36c307b3 | [
"Apache-2.0"
] | 2 | 2020-10-07T04:39:04.000Z | 2020-10-18T18:13:33.000Z | cf_xarray/helpers.py | jukent/cf-xarray | a5aa1d601f9c37ef47b4cd6026a65b57b727c043 | [
"Apache-2.0"
] | null | null | null | from typing import Optional, Sequence
import numpy as np
import xarray as xr
from xarray import DataArray
def bounds_to_vertices(
bounds: DataArray,
bounds_dim: str,
core_dims=None,
order: Optional[str] = "counterclockwise",
) -> DataArray:
"""
Convert bounds variable to vertices. There 2 cov... | 38.482993 | 150 | 0.612162 | from typing import Optional, Sequence
import numpy as np
import xarray as xr
from xarray import DataArray
def bounds_to_vertices(
bounds: DataArray,
bounds_dim: str,
core_dims=None,
order: Optional[str] = "counterclockwise",
) -> DataArray:
if core_dims is None:
core_dims = [dim for dim ... | true | true |
f7fad7b93eed2afcebf7935be2cdf12ef8d11a80 | 382 | py | Python | notebook/numpy_rot90_image.py | vhn0912/python-snippets | 80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038 | [
"MIT"
] | 174 | 2018-05-30T21:14:50.000Z | 2022-03-25T07:59:37.000Z | notebook/numpy_rot90_image.py | vhn0912/python-snippets | 80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038 | [
"MIT"
] | 5 | 2019-08-10T03:22:02.000Z | 2021-07-12T20:31:17.000Z | notebook/numpy_rot90_image.py | vhn0912/python-snippets | 80b2e1d6b2b8f12ae30d6dbe86d25bb2b3a02038 | [
"MIT"
] | 53 | 2018-04-27T05:26:35.000Z | 2022-03-25T07:59:37.000Z | import numpy as np
from PIL import Image
img = np.array(Image.open('data/src/lena.jpg'))
print(type(img))
# <class 'numpy.ndarray'>
print(img.shape)
# (225, 400, 3)
Image.fromarray(np.rot90(img)).save('data/dst/lena_np_rot90.jpg')
Image.fromarray(np.rot90(img, 2)).save('data/dst/lena_np_rot90_180.jpg')
Image.froma... | 23.875 | 72 | 0.727749 | import numpy as np
from PIL import Image
img = np.array(Image.open('data/src/lena.jpg'))
print(type(img))
print(img.shape)
Image.fromarray(np.rot90(img)).save('data/dst/lena_np_rot90.jpg')
Image.fromarray(np.rot90(img, 2)).save('data/dst/lena_np_rot90_180.jpg')
Image.fromarray(np.rot90(img, 3)).save('data/dst/le... | true | true |
f7fad81db54f53e418bc54ea11d1cd3af05b2249 | 67,856 | py | Python | lib/rucio/tests/test_bin_rucio.py | abhijeetsharma200/rucio | 02de234f82fa314988d2a16e7bf27077718e32ac | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/test_bin_rucio.py | abhijeetsharma200/rucio | 02de234f82fa314988d2a16e7bf27077718e32ac | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/test_bin_rucio.py | abhijeetsharma200/rucio | 02de234f82fa314988d2a16e7bf27077718e32ac | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2012-2021 CERN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 44.437459 | 167 | 0.608568 |
from __future__ import print_function
import os
import re
import unittest
from datetime import datetime, timedelta
from os import remove, unlink, listdir, rmdir, stat, path, environ
import pytest
from rucio.client.accountlimitclient import AccountLimitClient
from rucio.client.didcli... | true | true |
f7fad81f14d2704e351b3059e4600d9be81fecdd | 9,168 | py | Python | tools/testnet/files/dockerfiles/geth-testnet/run.py | anmolshl/raiden | f1cecb68cb43a2c00b2f719eadbe83137611a92a | [
"MIT"
] | 1 | 2018-11-26T01:40:37.000Z | 2018-11-26T01:40:37.000Z | tools/testnet/files/dockerfiles/geth-testnet/run.py | anmolshl/raiden | f1cecb68cb43a2c00b2f719eadbe83137611a92a | [
"MIT"
] | null | null | null | tools/testnet/files/dockerfiles/geth-testnet/run.py | anmolshl/raiden | f1cecb68cb43a2c00b2f719eadbe83137611a92a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import structlog
import os
import time
import subprocess
import sys
import logging
import click
from datetime import datetime, timedelta
import signal
import requests
from web3 import Web3, IPCProvider
from web3.utils.compat.compat_stdlib import Timeout
log = struct.get_logger(__name__)
# Since ... | 44.504854 | 99 | 0.754472 |
import structlog
import os
import time
import subprocess
import sys
import logging
import click
from datetime import datetime, timedelta
import signal
import requests
from web3 import Web3, IPCProvider
from web3.utils.compat.compat_stdlib import Timeout
log = struct.get_logger(__name__)
BOOTNODES = [
... | true | true |
f7fad87c49fa546f99dedc65a401b42b0841073f | 2,166 | py | Python | crawler/management/commands/export_csv.py | ahmedshahriar/bd-medicine-scraper | ea97d929fc9cdcbdde2602827cdc3d12709e2ca9 | [
"Apache-2.0"
] | 1 | 2022-03-17T03:02:49.000Z | 2022-03-17T03:02:49.000Z | crawler/management/commands/export_csv.py | ahmedshahriar/bd-medicine-scraper | ea97d929fc9cdcbdde2602827cdc3d12709e2ca9 | [
"Apache-2.0"
] | null | null | null | crawler/management/commands/export_csv.py | ahmedshahriar/bd-medicine-scraper | ea97d929fc9cdcbdde2602827cdc3d12709e2ca9 | [
"Apache-2.0"
] | null | null | null | import csv
import datetime
from crawler.models import Medicine, Generic, DosageForm, DrugClass, Indication, Manufacturer
from django.core.management import BaseCommand
from django.utils.autoreload import logger
class Command(BaseCommand): # see https://gist.github.com/2724472
help = "Mapping the generics with ... | 40.867925 | 115 | 0.574792 | import csv
import datetime
from crawler.models import Medicine, Generic, DosageForm, DrugClass, Indication, Manufacturer
from django.core.management import BaseCommand
from django.utils.autoreload import logger
class Command(BaseCommand):
help = "Mapping the generics with medicines"
def add_arguments(sel... | true | true |
f7fadaad7cccab57b8cbd393c836ecfc66caef2b | 1,085 | py | Python | orders/views.py | pauljherrera/avantiweb | 40b87e754e68a0e2adcf5e1640d5e2e0c8637d0a | [
"MIT"
] | null | null | null | orders/views.py | pauljherrera/avantiweb | 40b87e754e68a0e2adcf5e1640d5e2e0c8637d0a | [
"MIT"
] | null | null | null | orders/views.py | pauljherrera/avantiweb | 40b87e754e68a0e2adcf5e1640d5e2e0c8637d0a | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
from django.core.urlresolvers import reverse
from django.contrib.admin.views.decorators import staff_member_required
from .models import Order, Product
from .forms import OrderCreateForm
from .tasks import order_created
# Create your views here.
def ord... | 30.138889 | 78 | 0.748387 | from django.shortcuts import render, redirect, get_object_or_404
from django.core.urlresolvers import reverse
from django.contrib.admin.views.decorators import staff_member_required
from .models import Order, Product
from .forms import OrderCreateForm
from .tasks import order_created
def order_create(request, pk):
... | true | true |
f7fadb47db37dd5e50248bd8ac038911f732ddae | 1,092 | py | Python | user/collection/manager/modify_one.py | dsvalenciah/ROAp | 24cbff0e719c5009ec1f1e7190924d4d9297e992 | [
"MIT"
] | 4 | 2018-04-23T00:04:01.000Z | 2018-10-28T22:56:51.000Z | user/collection/manager/modify_one.py | dsvalenciah/ROAp | 24cbff0e719c5009ec1f1e7190924d4d9297e992 | [
"MIT"
] | 23 | 2017-12-22T08:27:35.000Z | 2021-12-13T19:57:35.000Z | user/collection/manager/modify_one.py | dsvalenciah/ROAp | 24cbff0e719c5009ec1f1e7190924d4d9297e992 | [
"MIT"
] | 1 | 2020-06-03T02:07:26.000Z | 2020-06-03T02:07:26.000Z |
from datetime import datetime
from manager.exceptions.user import (
UserPermissionError, UserNotFoundError, UserSchemaError
)
from manager.schemas.user import User
def modify_one(db_client, old_user_id, new_user, auth_user):
"""Modify user."""
_ = auth_user.get('language')
if auth_user.get('role')... | 24.818182 | 76 | 0.60989 |
from datetime import datetime
from manager.exceptions.user import (
UserPermissionError, UserNotFoundError, UserSchemaError
)
from manager.schemas.user import User
def modify_one(db_client, old_user_id, new_user, auth_user):
_ = auth_user.get('language')
if auth_user.get('role') != 'administrator':
... | true | true |
f7fadbbb6e1c64dad3ccc8b8fadb28371e058de9 | 263 | py | Python | 04Cuarto/Sistemas_y_proteccion_de_sistemas_informaticos_SPSI/Practica5/src/model/__init__.py | elsudano/Facultad | 8ff2c5904f0a38a3a0682e040da4439f2bc872f2 | [
"MIT"
] | 2 | 2017-02-20T09:26:42.000Z | 2021-11-21T21:56:35.000Z | 04Cuarto/Sistemas_y_proteccion_de_sistemas_informaticos_SPSI/Practica5/src/model/__init__.py | elsudano/Facultad | 8ff2c5904f0a38a3a0682e040da4439f2bc872f2 | [
"MIT"
] | 1 | 2016-10-06T16:59:39.000Z | 2017-09-21T08:04:51.000Z | 04Cuarto/Sistemas_y_proteccion_de_sistemas_informaticos_SPSI/Practica5/src/model/__init__.py | elsudano/Facultad | 8ff2c5904f0a38a3a0682e040da4439f2bc872f2 | [
"MIT"
] | 4 | 2016-10-06T16:41:01.000Z | 2019-11-21T12:37:20.000Z | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""Fichero de inicialización del modulo
Este fichero se usa para poder inicializar las diferentes partes del modulo
se usa para poner los imports necesarios para la aplicación
"""
from src.model.Models import MainModel
| 26.3 | 75 | 0.764259 |
from src.model.Models import MainModel
| true | true |
f7fadc225c598d19f5506d8fce73a39b31507e8d | 3,463 | py | Python | Condor/Tools/Fun/Windows.py | OriolOriolOriol/Condor | 5b855ff7170e43149f9e9f81a97b6b88282915c5 | [
"MIT"
] | null | null | null | Condor/Tools/Fun/Windows.py | OriolOriolOriol/Condor | 5b855ff7170e43149f9e9f81a97b6b88282915c5 | [
"MIT"
] | null | null | null | Condor/Tools/Fun/Windows.py | OriolOriolOriol/Condor | 5b855ff7170e43149f9e9f81a97b6b88282915c5 | [
"MIT"
] | 1 | 2020-11-04T08:32:26.000Z | 2020-11-04T08:32:26.000Z |
# Import modules
from ctypes import windll, wintypes, create_unicode_buffer, WINFUNCTYPE, Structure, c_bool, c_int, c_long, c_ulong, byref, POINTER
from psutil import process_iter, Process # pip install psutil
__user32 = windll.user32
__EnumWindows = __user32.EnumWindows
__EnumWindowsProc = WINFUNCTYPE(c_bool, POINTE... | 32.669811 | 130 | 0.645683 |
from ctypes import windll, wintypes, create_unicode_buffer, WINFUNCTYPE, Structure, c_bool, c_int, c_long, c_ulong, byref, POINTER
from psutil import process_iter, Process
__user32 = windll.user32
__EnumWindows = __user32.EnumWindows
__EnumWindowsProc = WINFUNCTYPE(c_bool, POINTER(c_int), POINTER(c_int))
__IsWindow... | true | true |
f7fadc2cb2daab721548b8fb3360d0ce49f6e886 | 8,030 | py | Python | src/shop/drognan.py | Cho0joy/botty | ed9c22b78a527443b46fdc3070cb128f32501e2e | [
"MIT"
] | 1 | 2022-02-09T03:19:59.000Z | 2022-02-09T03:19:59.000Z | src/shop/drognan.py | Cho0joy/botty | ed9c22b78a527443b46fdc3070cb128f32501e2e | [
"MIT"
] | null | null | null | src/shop/drognan.py | Cho0joy/botty | ed9c22b78a527443b46fdc3070cb128f32501e2e | [
"MIT"
] | 2 | 2022-01-10T12:46:31.000Z | 2022-02-12T20:26:16.000Z | import datetime
import os
import time
import math
import random
from typing import Dict, Tuple, Union, List, Callable
import keyboard
import numpy as np
from screen import Screen
from config import Config
from logger import Logger
from npc_manager import NpcManager, Npc
from template_finder import TemplateFinder
from... | 45.625 | 142 | 0.602864 | import datetime
import os
import time
import math
import random
from typing import Dict, Tuple, Union, List, Callable
import keyboard
import numpy as np
from screen import Screen
from config import Config
from logger import Logger
from npc_manager import NpcManager, Npc
from template_finder import TemplateFinder
from... | true | true |
f7fadc5982d41fcde02b58713f0736117743ac26 | 5,835 | py | Python | utils/pointconv_util.py | MatteoPerotto/pointconv | 204a0d534c4d75e80bde7722c075a78365a64929 | [
"MIT"
] | 471 | 2019-03-26T02:01:55.000Z | 2022-03-10T03:09:10.000Z | utils/pointconv_util.py | MatteoPerotto/pointconv | 204a0d534c4d75e80bde7722c075a78365a64929 | [
"MIT"
] | 35 | 2019-03-28T05:28:17.000Z | 2021-08-19T10:22:47.000Z | utils/pointconv_util.py | MatteoPerotto/pointconv | 204a0d534c4d75e80bde7722c075a78365a64929 | [
"MIT"
] | 115 | 2019-04-21T07:33:00.000Z | 2022-03-04T07:21:12.000Z | """
Helper Function for PointConv
Author: Wenxuan Wu
Date: July 2018
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import random
import numpy as np
import tensorflow as tf
from transforms3d.euler import euler2mat
import os
import sys
BASE_D... | 33.342857 | 111 | 0.643873 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import random
import numpy as np
import tensorflow as tf
from transforms3d.euler import euler2mat
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.j... | true | true |
f7fadce1ff2f06e2e0bd5502472662090c6de119 | 3,074 | py | Python | QA_system/QA_model_build.py | Ennis0620/TF_IDF_QAsystem | 1b4e7a9408583fc43a0cd48c155f4f61e752ed9d | [
"MIT"
] | 2 | 2022-01-11T06:59:57.000Z | 2022-01-18T02:54:44.000Z | QA_system/QA_model_build.py | Ennis0620/TF_IDF_QAsystem | 1b4e7a9408583fc43a0cd48c155f4f61e752ed9d | [
"MIT"
] | null | null | null | QA_system/QA_model_build.py | Ennis0620/TF_IDF_QAsystem | 1b4e7a9408583fc43a0cd48c155f4f61e752ed9d | [
"MIT"
] | null | null | null | import re
import time
import jieba
import math
import json
#設定斷詞詞庫
jieba.load_userdict('lexicon_dict.txt')
len_Q = 0 #存下共有多少問題
IDF={} #字詞庫中所有詞彙
s = time.time()
QA_model = [] #要儲存的model 以[{},{},...]的形式儲存
#進行問題的斷詞
with open("Gossiping-QA-Dataset.txt","r",encoding='utf-8-sig') as fp:
all_ = fp.r... | 28.201835 | 85 | 0.592713 | import re
import time
import jieba
import math
import json
jieba.load_userdict('lexicon_dict.txt')
len_Q = 0
IDF={}
s = time.time()
QA_model = []
with open("Gossiping-QA-Dataset.txt","r",encoding='utf-8-sig') as fp:
all_ = fp.readlines()
for index,row in enumerate(all_):
... | true | true |
f7fadd195d527c89e44441d529ff73afa1c40bd3 | 17,881 | py | Python | dataproc/google/cloud/dataproc_v1/proto/operations_pb2.py | hugovk/google-cloud-python | b387134827dbc3be0e1b431201e0875798002fda | [
"Apache-2.0"
] | 1 | 2019-03-26T21:44:51.000Z | 2019-03-26T21:44:51.000Z | dataproc/google/cloud/dataproc_v1/proto/operations_pb2.py | hugovk/google-cloud-python | b387134827dbc3be0e1b431201e0875798002fda | [
"Apache-2.0"
] | 40 | 2019-07-16T10:04:48.000Z | 2020-01-20T09:04:59.000Z | dataproc/google/cloud/dataproc_v1/proto/operations_pb2.py | hugovk/google-cloud-python | b387134827dbc3be0e1b431201e0875798002fda | [
"Apache-2.0"
] | 2 | 2019-11-13T05:27:48.000Z | 2020-01-21T06:35:19.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/dataproc_v1/proto/operations.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import mes... | 36.792181 | 1,636 | 0.645937 |
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
... | true | true |
f7faddaf8f023fbb394a53850277c7c04cba5ee8 | 7,431 | py | Python | models/dfcvae.py | threewisemonkeys-as/PyTorch-VAE | 4ed0fc7581d4792b435134aa9e06d5e35a5db118 | [
"Apache-2.0"
] | null | null | null | models/dfcvae.py | threewisemonkeys-as/PyTorch-VAE | 4ed0fc7581d4792b435134aa9e06d5e35a5db118 | [
"Apache-2.0"
] | null | null | null | models/dfcvae.py | threewisemonkeys-as/PyTorch-VAE | 4ed0fc7581d4792b435134aa9e06d5e35a5db118 | [
"Apache-2.0"
] | null | null | null | from typing import List, Optional
import torch
from torch import nn
from torch.nn import functional as F
from torchvision.models import vgg19_bn
from .base import BaseVAE
class DFCVAE(BaseVAE):
def __init__(
self,
in_channels: int,
latent_dim: int,
hidden_dims: List = None,
... | 32.030172 | 102 | 0.541246 | from typing import List, Optional
import torch
from torch import nn
from torch.nn import functional as F
from torchvision.models import vgg19_bn
from .base import BaseVAE
class DFCVAE(BaseVAE):
def __init__(
self,
in_channels: int,
latent_dim: int,
hidden_dims: List = None,
... | true | true |
f7fae097f524ea572e5c0c348a1f0770ffc40386 | 55,837 | py | Python | nemo/core/classes/modelPT.py | Fackor/NeMo | 941ef1fd71bd2515a4ba7092d65146edfddc1229 | [
"Apache-2.0"
] | null | null | null | nemo/core/classes/modelPT.py | Fackor/NeMo | 941ef1fd71bd2515a4ba7092d65146edfddc1229 | [
"Apache-2.0"
] | null | null | null | nemo/core/classes/modelPT.py | Fackor/NeMo | 941ef1fd71bd2515a4ba7092d65146edfddc1229 | [
"Apache-2.0"
] | 2 | 2021-02-04T14:45:50.000Z | 2021-02-04T14:56:05.000Z | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 43.150696 | 135 | 0.60356 |
import copy
import inspect
import os
import shutil
import tarfile
import tempfile
from abc import abstractmethod
from dataclasses import is_dataclass
from os import path
from typing import Callable, Dict, List, Optional, Union
import hydra
import torch
from omegaconf import DictConfig, OmegaConf, open_di... | true | true |
f7fae0ac1740e6da96a906a649440d334593392e | 8,637 | py | Python | refactorings/utils/scope_listener.py | mossj77/CodART | ac83a49a4aa9310b09da12fb476a84586812310b | [
"MIT"
] | 1 | 2021-10-10T23:56:49.000Z | 2021-10-10T23:56:49.000Z | refactorings/utils/scope_listener.py | pouorix/CodART | 84b35a5a14e583d88319d7f6c2de8dc3b3dc83b2 | [
"MIT"
] | null | null | null | refactorings/utils/scope_listener.py | pouorix/CodART | 84b35a5a14e583d88319d7f6c2de8dc3b3dc83b2 | [
"MIT"
] | null | null | null | from typing import Optional
from antlr4 import FileStream, ParseTreeWalker
from antlr4.TokenStreamRewriter import TokenStreamRewriter
from gen.java.JavaLexer import JavaLexer
from .utils_listener_fast import *
from enum import Enum
class ScopeType(Enum):
PACKAGE = 0
CLASS = 1
METHOD = 2
STATIC_BLOCK ... | 39.619266 | 123 | 0.654973 | from typing import Optional
from antlr4 import FileStream, ParseTreeWalker
from antlr4.TokenStreamRewriter import TokenStreamRewriter
from gen.java.JavaLexer import JavaLexer
from .utils_listener_fast import *
from enum import Enum
class ScopeType(Enum):
PACKAGE = 0
CLASS = 1
METHOD = 2
STATIC_BLOCK ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.