hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76d72facfe73ceb37076d31896fd740cad708e6 | 4,941 | py | Python | loyverse/endpoints/customers.py | matteobe/loyverse | 04b2359c947eca0d9f9aad46d3bc94edfdb7762b | [
"MIT"
] | null | null | null | loyverse/endpoints/customers.py | matteobe/loyverse | 04b2359c947eca0d9f9aad46d3bc94edfdb7762b | [
"MIT"
] | 12 | 2020-11-01T21:24:49.000Z | 2021-01-31T20:26:44.000Z | loyverse/endpoints/customers.py | matteobe/loyverse | 04b2359c947eca0d9f9aad46d3bc94edfdb7762b | [
"MIT"
] | 1 | 2020-11-04T12:56:33.000Z | 2020-11-04T12:56:33.000Z | """
Customers endpoint wrapper class
Possible requests:
* get_by_query: get customers that respect passed in query parameters
* get_by_id: get customer with given customer ID
* get_by_email: get customer with given email
* get_by_creation_date: get customers created at specific date
* get_by_creation_dates: get custo... | 37.431818 | 115 | 0.638535 |
from datetime import datetime, timezone
from loyverse.api import Api
from loyverse.utils.dates import utc_isoformat, day_start, day_end
class Customers:
def __init__(self, api: Api):
self._api = api
self._path = 'customers'
def get_by_query(self, customer_ids: list = None, email: str = None... | true | true |
f76d741fa6d806ba867f24584b39ba62cf565179 | 852 | py | Python | SimpleCV/tests/test_cameras.py | tpltnt/SimpleCV | 9fd75457cce5fd111c4d251b1076b9447fa4f1a2 | [
"BSD-3-Clause"
] | 8 | 2016-12-11T20:28:03.000Z | 2022-02-11T21:15:26.000Z | SimpleCV/tests/test_cameras.py | tpltnt/SimpleCV | 9fd75457cce5fd111c4d251b1076b9447fa4f1a2 | [
"BSD-3-Clause"
] | 19 | 2016-11-24T20:28:18.000Z | 2017-03-18T16:40:40.000Z | SimpleCV/tests/test_cameras.py | tpltnt/SimpleCV | 9fd75457cce5fd111c4d251b1076b9447fa4f1a2 | [
"BSD-3-Clause"
] | 3 | 2016-11-27T22:29:08.000Z | 2019-12-04T00:35:32.000Z | #!/usr/bin/python
from __future__ import print_function
import os, sys
from SimpleCV import *
from nose.tools import with_setup
testoutput = "sampleimages/cam.jpg"
def test_virtual_camera_constructor():
mycam = VirtualCamera(testoutput, 'image')
props = mycam.getAllProperties()
for i in props.keys():... | 18.933333 | 61 | 0.652582 |
from __future__ import print_function
import os, sys
from SimpleCV import *
from nose.tools import with_setup
testoutput = "sampleimages/cam.jpg"
def test_virtual_camera_constructor():
mycam = VirtualCamera(testoutput, 'image')
props = mycam.getAllProperties()
for i in props.keys():
print(str... | true | true |
f76d743e89739e090e96a513a654672906a7a7c2 | 6,694 | py | Python | gui/qt/exception_window.py | ComputerCraftr/openswap | 7de04aa80dab79bebe4b64483011dad70a48694c | [
"MIT"
] | 16 | 2018-11-05T13:19:02.000Z | 2021-04-06T12:11:49.000Z | gui/qt/exception_window.py | ComputerCraftr/openswap | 7de04aa80dab79bebe4b64483011dad70a48694c | [
"MIT"
] | 9 | 2018-09-19T03:37:26.000Z | 2019-04-17T21:58:27.000Z | gui/qt/exception_window.py | ComputerCraftr/openswap | 7de04aa80dab79bebe4b64483011dad70a48694c | [
"MIT"
] | 5 | 2018-11-05T13:19:02.000Z | 2020-10-20T09:15:54.000Z | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, ... | 34.505155 | 173 | 0.672841 |
import json
import locale
import platform
import traceback
import html
import requests
from PyQt5.QtCore import QObject
import PyQt5.QtCore as QtCore
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import *
from electroncash.i18n import _
import sys
from electroncash import PACKAGE_VERSION
issue_template = """... | true | true |
f76d75a75fc97fae684fcd5fd6067ba0d92c174c | 3,805 | py | Python | chinilla/rpc/farmer_rpc_client.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | chinilla/rpc/farmer_rpc_client.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | chinilla/rpc/farmer_rpc_client.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, List, Optional
from chinilla.rpc.farmer_rpc_api import PlotInfoRequestData, PlotPathRequestData
from chinilla.rpc.rpc_client import RpcClient
from chinilla.types.blockchain_format.sized_bytes import bytes32
from chinilla.util.misc import dataclass_to_json_dict
class FarmerRpcClient(RpcC... | 47.5625 | 119 | 0.706439 | from typing import Any, Dict, List, Optional
from chinilla.rpc.farmer_rpc_api import PlotInfoRequestData, PlotPathRequestData
from chinilla.rpc.rpc_client import RpcClient
from chinilla.types.blockchain_format.sized_bytes import bytes32
from chinilla.util.misc import dataclass_to_json_dict
class FarmerRpcClient(RpcC... | true | true |
f76d75e66916099e7829c1357b47f72e91c49818 | 5,847 | py | Python | maskrcnn_benchmark/data/datasets/FaceDataset.py | p517332051/face_benchmark | c76c2b2142ecf65b7bace4b007a33fa4e795d2d0 | [
"MIT"
] | 2 | 2020-04-02T14:53:29.000Z | 2021-07-13T04:31:47.000Z | maskrcnn_benchmark/data/datasets/FaceDataset.py | p517332051/face_benchmark | c76c2b2142ecf65b7bace4b007a33fa4e795d2d0 | [
"MIT"
] | null | null | null | maskrcnn_benchmark/data/datasets/FaceDataset.py | p517332051/face_benchmark | c76c2b2142ecf65b7bace4b007a33fa4e795d2d0 | [
"MIT"
] | 1 | 2020-07-13T06:02:42.000Z | 2020-07-13T06:02:42.000Z | import os
import numpy as np
import torch
import torch.utils.data as data
import random
import tqdm
from PIL import Image
class FaceDataset(data.Dataset):
def __init__(self, data_dir, ann_file, transforms=None, augmenter=None,im_info=[112,96]):
assert transforms is not None
self.root = data_dir
... | 36.54375 | 122 | 0.593467 | import os
import numpy as np
import torch
import torch.utils.data as data
import random
import tqdm
from PIL import Image
class FaceDataset(data.Dataset):
def __init__(self, data_dir, ann_file, transforms=None, augmenter=None,im_info=[112,96]):
assert transforms is not None
self.root = data_dir
... | true | true |
f76d76939ddcccc1e5ead7430b2bd575d1950314 | 5,089 | py | Python | server.py | bor1e/mydaily | afe65e7f91066a04475c20043f4202f32c825351 | [
"MIT"
] | 1 | 2018-07-03T14:54:43.000Z | 2018-07-03T14:54:43.000Z | server.py | bor1e/mydaily | afe65e7f91066a04475c20043f4202f32c825351 | [
"MIT"
] | 3 | 2021-03-31T18:52:14.000Z | 2021-12-13T19:48:18.000Z | server.py | bor1e/mydaily | afe65e7f91066a04475c20043f4202f32c825351 | [
"MIT"
] | null | null | null | from bottle import default_app, route, run, static_file, template, install, request, response, redirect
import bottle
from bottle_sqlite import SQLitePlugin
from datetime import date, datetime, timedelta
import random
import string
from parser import Parser
from functools import wraps
import logging
app=application=de... | 36.092199 | 112 | 0.639811 | from bottle import default_app, route, run, static_file, template, install, request, response, redirect
import bottle
from bottle_sqlite import SQLitePlugin
from datetime import date, datetime, timedelta
import random
import string
from parser import Parser
from functools import wraps
import logging
app=application=de... | true | true |
f76d76a5906bdc542b6e74529091b4c7c4d52fc8 | 455 | py | Python | TrabajoDeFP/Ejercicio8.py | Sharnol-Tec/Trabajo | 0bde9e4677acb921002e757e3a7d65991061fc84 | [
"Apache-2.0"
] | null | null | null | TrabajoDeFP/Ejercicio8.py | Sharnol-Tec/Trabajo | 0bde9e4677acb921002e757e3a7d65991061fc84 | [
"Apache-2.0"
] | null | null | null | TrabajoDeFP/Ejercicio8.py | Sharnol-Tec/Trabajo | 0bde9e4677acb921002e757e3a7d65991061fc84 | [
"Apache-2.0"
] | null | null | null | #datos de entrada
inporte=float(input("digite el importe total vendido en el mes:"))
#proceso
sueldo_basico=300
comision_ventas=0.09*inporte
sueldo_bruto=sueldo_basico + comision_ventas
descuento=0.11*sueldo_bruto
sueldo_neto=sueldo_bruto-descuento
#salida
print("sueldo basico:s/.",sueldo_basico)
print("comision por ve... | 32.5 | 66 | 0.8 | inporte=float(input("digite el importe total vendido en el mes:"))
sueldo_basico=300
comision_ventas=0.09*inporte
sueldo_bruto=sueldo_basico + comision_ventas
descuento=0.11*sueldo_bruto
sueldo_neto=sueldo_bruto-descuento
print("sueldo basico:s/.",sueldo_basico)
print("comision por ventas:s/.",comision_ventas)
print("s... | true | true |
f76d7820c17761cdc75454ddf42d280d25f7b513 | 3,995 | py | Python | fastapi_discord/client.py | abhishek0220/fastapi-discord | f06cc61a4e800eae5c09fd55329a74fbfc6e270e | [
"MIT"
] | null | null | null | fastapi_discord/client.py | abhishek0220/fastapi-discord | f06cc61a4e800eae5c09fd55329a74fbfc6e270e | [
"MIT"
] | null | null | null | fastapi_discord/client.py | abhishek0220/fastapi-discord | f06cc61a4e800eae5c09fd55329a74fbfc6e270e | [
"MIT"
] | null | null | null | import aiohttp
from fastapi import Request
from .models import User, Guild
from .config import DISCORD_URL, DISCORD_API_URL, DISCORD_TOKEN_URL, DISCORD_OAUTH_URL, DISCORD_OAUTH_AUTHENTICATION_URL
from .exeptions import Unauthorized, RateLimited, InvalidRequest
import re
from aiocache import cached
from functools import... | 34.439655 | 120 | 0.618773 | import aiohttp
from fastapi import Request
from .models import User, Guild
from .config import DISCORD_URL, DISCORD_API_URL, DISCORD_TOKEN_URL, DISCORD_OAUTH_URL, DISCORD_OAUTH_AUTHENTICATION_URL
from .exeptions import Unauthorized, RateLimited, InvalidRequest
import re
from aiocache import cached
from functools import... | true | true |
f76d7854eead84b3a77b3ae0472200718db62a55 | 747 | py | Python | cv/urls.py | mikebader/django-cv | 9c0150e9299042f4e908b720cf3f3cd8f133050b | [
"BSD-3-Clause"
] | 3 | 2018-09-22T05:32:26.000Z | 2019-10-18T01:34:06.000Z | cv/urls.py | mikebader/django-cv | 9c0150e9299042f4e908b720cf3f3cd8f133050b | [
"BSD-3-Clause"
] | 3 | 2020-08-02T19:34:31.000Z | 2022-01-25T03:00:53.000Z | cv/urls.py | mikebader/django-cv | 9c0150e9299042f4e908b720cf3f3cd8f133050b | [
"BSD-3-Clause"
] | null | null | null | from django.urls import path
from . import views
app_name = 'cv'
urlpatterns = [
path('', views.CVView.as_view(), name='cv_list'),
path('pdf/', views.cv_pdf, name='cv_pdf'),
path('forms/<str:model_name>/add/', views.CVCreateView.as_view(),name='cv_add'),
path('forms/<str:model_name>/<int:pk>/edit/', ... | 43.941176 | 99 | 0.677376 | from django.urls import path
from . import views
app_name = 'cv'
urlpatterns = [
path('', views.CVView.as_view(), name='cv_list'),
path('pdf/', views.cv_pdf, name='cv_pdf'),
path('forms/<str:model_name>/add/', views.CVCreateView.as_view(),name='cv_add'),
path('forms/<str:model_name>/<int:pk>/edit/', ... | true | true |
f76d78c96f67109913bbb1db148063081b9409b6 | 2,313 | py | Python | python3/koans/about_comprehension.py | brianpaff1992/python_koans | eadcbcd2e575ecc769dd35295871caa97c59587c | [
"MIT"
] | null | null | null | python3/koans/about_comprehension.py | brianpaff1992/python_koans | eadcbcd2e575ecc769dd35295871caa97c59587c | [
"MIT"
] | null | null | null | python3/koans/about_comprehension.py | brianpaff1992/python_koans | eadcbcd2e575ecc769dd35295871caa97c59587c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutComprehension(Koan):
def test_creating_lists_with_list_comprehensions(self):
feast = ['lambs', 'sloths', 'orangutans', 'breakfast cereals',
'fruit bats']
comprehension = [delicacy.capitalize() for de... | 37.918033 | 108 | 0.657588 |
from runner.koan import *
class AboutComprehension(Koan):
def test_creating_lists_with_list_comprehensions(self):
feast = ['lambs', 'sloths', 'orangutans', 'breakfast cereals',
'fruit bats']
comprehension = [delicacy.capitalize() for delicacy in feast]
self.assertEqual('La... | true | true |
f76d78f15e8cbe8e413bb44360ca51ec3b090f50 | 6,029 | py | Python | calculator.py | vbusov/smart_calculator | 75c9770cbae96b1eafaf2129c9687c9e697bf6a6 | [
"MIT"
] | null | null | null | calculator.py | vbusov/smart_calculator | 75c9770cbae96b1eafaf2129c9687c9e697bf6a6 | [
"MIT"
] | null | null | null | calculator.py | vbusov/smart_calculator | 75c9770cbae96b1eafaf2129c9687c9e697bf6a6 | [
"MIT"
] | null | null | null | from collections import deque
class Calculator:
def __init__(self):
self.vars = {}
self.help = "This calculator supports arithmetic operations " \
+ "on integers: addition, subtraction, " \
+ "multiplication, division and exponentiation. " \
... | 32.589189 | 86 | 0.466246 | from collections import deque
class Calculator:
def __init__(self):
self.vars = {}
self.help = "This calculator supports arithmetic operations " \
+ "on integers: addition, subtraction, " \
+ "multiplication, division and exponentiation. " \
... | true | true |
f76d7959ef943eb33c9056e6e2156649361f7a8d | 6,814 | py | Python | DeepHash/model/dtq/util.py | peternara/DeepHash | c6f4c6733f619718d437bf39ef9fb6854476f20c | [
"MIT"
] | null | null | null | DeepHash/model/dtq/util.py | peternara/DeepHash | c6f4c6733f619718d437bf39ef9fb6854476f20c | [
"MIT"
] | null | null | null | DeepHash/model/dtq/util.py | peternara/DeepHash | c6f4c6733f619718d437bf39ef9fb6854476f20c | [
"MIT"
] | null | null | null | import numpy as np
import math
from distance.npversion import distance
class Dataset(object):
def __init__(self, dataset, output_dim, code_dim):
self._dataset = dataset
self.n_samples = dataset.n_samples
self._train = dataset.train
self._output = np.zeros((self.n_samples, output_dim... | 37.43956 | 123 | 0.58233 | import numpy as np
import math
from distance.npversion import distance
class Dataset(object):
def __init__(self, dataset, output_dim, code_dim):
self._dataset = dataset
self.n_samples = dataset.n_samples
self._train = dataset.train
self._output = np.zeros((self.n_samples, output_dim... | true | true |
f76d7b3df9bfbe1668138fe6b3431ead2825a73b | 13,091 | py | Python | python/tvm/relay/qnn/op/qnn.py | LiangHao151941/tvm | a1854339cb1a3b609a3aefaa01cf39bb708e3feb | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 3 | 2021-02-23T22:06:01.000Z | 2021-09-30T09:59:17.000Z | python/tvm/relay/qnn/op/qnn.py | LiangHao151941/tvm | a1854339cb1a3b609a3aefaa01cf39bb708e3feb | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | python/tvm/relay/qnn/op/qnn.py | LiangHao151941/tvm | a1854339cb1a3b609a3aefaa01cf39bb708e3feb | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 30.094253 | 98 | 0.61401 |
from __future__ import absolute_import as _abs
from tvm.relay.expr import Tuple
from . import _make
def requantize(data,
input_scale,
input_zero_point,
output_scale,
output_zero_point,
axis=-1,
rounding="UPWARD",
... | true | true |
f76d7bcf84ad710baf9ea9a5daef85a825f71ff5 | 2,056 | py | Python | dnacentersdk/models/validators/v2_1_2/jsd_00a2fa6146089317.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | dnacentersdk/models/validators/v2_1_2/jsd_00a2fa6146089317.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | dnacentersdk/models/validators/v2_1_2/jsd_00a2fa6146089317.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DNA Center Add members to the tag data model.
Copyright (c) 2019-2020 Cisco and/or its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, ... | 35.448276 | 78 | 0.712549 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import fastjsonschema
import json
from dnacentersdk.exceptions import MalformedRequest
from builtins import *
class JSONSchemaValidator00A2Fa6146089317(object):
def __init__(self):
super(JSONSchemaV... | true | true |
f76d7c359579d9742d477688dcb7f70ead7ad599 | 1,243 | py | Python | HLTriggerOffline/Exotica/python/analyses/hltExoticaDiPhoton_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | HLTriggerOffline/Exotica/python/analyses/hltExoticaDiPhoton_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | HLTriggerOffline/Exotica/python/analyses/hltExoticaDiPhoton_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
DiPhotonPSet = cms.PSet(
hltPathsToCheck = cms.vstring(
"HLT_DoublePhoton85_v", # Run2 proposal # Claimed path for Run3
"HLT_DoublePhoton70_v", # Claimed path for Run3
# "HLT_DoublePhoton33_CaloIdL_v" # Not claimed path for Run3
"HLT_Diphot... | 51.791667 | 147 | 0.656476 | import FWCore.ParameterSet.Config as cms
DiPhotonPSet = cms.PSet(
hltPathsToCheck = cms.vstring(
"HLT_DoublePhoton85_v", "HLT_DoublePhoton70_v", "HLT_Diphoton30_18_R9IdL_AND_HE_AND_IsoCaloId_NoPixelVeto_Mass55_v", "HLT_Diphoton30_18_R9IdL_AND_HE_AND_IsoCaloId_NoPixelVeto_v", ... | true | true |
f76d7cb7957023763cf012a1663dc319426d8833 | 397 | py | Python | exampleapp/wsgi.py | Cuda-Chen/django-mysql-github-actions-demo | 4e5309f8b8bd8596bcf8923156a4896d6a7c425a | [
"MIT"
] | null | null | null | exampleapp/wsgi.py | Cuda-Chen/django-mysql-github-actions-demo | 4e5309f8b8bd8596bcf8923156a4896d6a7c425a | [
"MIT"
] | null | null | null | exampleapp/wsgi.py | Cuda-Chen/django-mysql-github-actions-demo | 4e5309f8b8bd8596bcf8923156a4896d6a7c425a | [
"MIT"
] | null | null | null | """
WSGI config for exampleapp project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'exampleapp.settings')
application = get_wsgi_application()
| true | true |
f76d7e097c999ff6acb3552b9e728faa5592c2fc | 4,066 | py | Python | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Visualisation/PhysicsGraph/ParticleDragger.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Visualisation/PhysicsGraph/ParticleDragger.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Visualisation/PhysicsGraph/ParticleDragger.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... | 34.168067 | 101 | 0.628628 |
"""\
================================
Drag handler for Topology Viewer
================================
A subclass of Kamaelia.UI.MH.DragHandler that implements "click and hold"
dragging of particles for the TopologyViewer.
Example Usage
-------------
See source for TopologyViewer.
How does it work?
----------... | false | true |
f76d8047b3354f12961b4a11fa01e477d34eb572 | 1,642 | py | Python | index_queries.py | fredriko/search_with_machine_learning_course | 85670d7adf337fede418fa5665b3c5ee80e42b2b | [
"Apache-2.0"
] | null | null | null | index_queries.py | fredriko/search_with_machine_learning_course | 85670d7adf337fede418fa5665b3c5ee80e42b2b | [
"Apache-2.0"
] | null | null | null | index_queries.py | fredriko/search_with_machine_learning_course | 85670d7adf337fede418fa5665b3c5ee80e42b2b | [
"Apache-2.0"
] | null | null | null | import click
import pandas as pd
from opensearchpy import OpenSearch
from opensearchpy.helpers import bulk
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logging.basicConfig(format='%(levelname)s:%(message)s')
def get_opensearch():
host = 'localhost'
port = 9200
auth =... | 27.830508 | 75 | 0.627284 | import click
import pandas as pd
from opensearchpy import OpenSearch
from opensearchpy.helpers import bulk
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logging.basicConfig(format='%(levelname)s:%(message)s')
def get_opensearch():
host = 'localhost'
port = 9200
auth =... | true | true |
f76d806252da3e6aa550d514b6adbc68ecfbbb61 | 1,470 | py | Python | 4_proxy/test_proxy_example.py | pavlovprojects/python_qa_logging | 7734a36396788b5e6ebff09928527a46507f70d4 | [
"MIT"
] | null | null | null | 4_proxy/test_proxy_example.py | pavlovprojects/python_qa_logging | 7734a36396788b5e6ebff09928527a46507f70d4 | [
"MIT"
] | null | null | null | 4_proxy/test_proxy_example.py | pavlovprojects/python_qa_logging | 7734a36396788b5e6ebff09928527a46507f70d4 | [
"MIT"
] | null | null | null | import pytest
import urllib.parse
from helper import chromedriver
from browsermobproxy import Server, Client
from selenium import webdriver
@pytest.fixture
def proxy_server(request):
server = Server("browsermob-proxy/bin/browsermob-proxy")
server.start()
client = Client("localhost:8080")
server.creat... | 31.956522 | 95 | 0.736054 | import pytest
import urllib.parse
from helper import chromedriver
from browsermobproxy import Server, Client
from selenium import webdriver
@pytest.fixture
def proxy_server(request):
server = Server("browsermob-proxy/bin/browsermob-proxy")
server.start()
client = Client("localhost:8080")
server.creat... | true | true |
f76d80ad4a8eefca189eb4ba238ce35724196b65 | 586 | py | Python | euler/palindronic.py | lsbardel/mathfun | 98e7c210409c2b5777e91059c3651cef4f3045dd | [
"BSD-3-Clause"
] | null | null | null | euler/palindronic.py | lsbardel/mathfun | 98e7c210409c2b5777e91059c3651cef4f3045dd | [
"BSD-3-Clause"
] | null | null | null | euler/palindronic.py | lsbardel/mathfun | 98e7c210409c2b5777e91059c3651cef4f3045dd | [
"BSD-3-Clause"
] | null | null | null | """https://projecteuler.net/problem=4
"""
def palindromic(digits):
lower = 10**(digits-1)
d1 = 10*lower-1
mp = 0
while d1 >= lower:
d2 = d1
while d2 >= lower:
p = d1*d2
if p < mp:
break
ps = str(p)
if ps == ps[::-1]: # ch... | 18.903226 | 51 | 0.426621 |
def palindromic(digits):
lower = 10**(digits-1)
d1 = 10*lower-1
mp = 0
while d1 >= lower:
d2 = d1
while d2 >= lower:
p = d1*d2
if p < mp:
break
ps = str(p)
if ps == ps[::-1]: mp = p
break
... | true | true |
f76d80d47c81ce9fa6bf36a73fa4d3a3ea82eae4 | 5,983 | py | Python | baseline/tf/seq2seq/training/datasets.py | blester125/baseline | 4ad4147d4a88a42b309c6784a95b0b9f1faa2c60 | [
"Apache-2.0"
] | 1 | 2019-08-13T21:35:20.000Z | 2019-08-13T21:35:20.000Z | baseline/tf/seq2seq/training/datasets.py | blester125/baseline | 4ad4147d4a88a42b309c6784a95b0b9f1faa2c60 | [
"Apache-2.0"
] | null | null | null | baseline/tf/seq2seq/training/datasets.py | blester125/baseline | 4ad4147d4a88a42b309c6784a95b0b9f1faa2c60 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from baseline.tf.tfy import TRAIN_FLAG
from eight_mile.utils import listify
from baseline.utils import get_model_file, get_metric_cmp
from baseline.train import create_trainer, register_training_func
from baseline.tf.seq2seq.training.utils import to_tensors, SHUF_BUF_SZ, NUM_PREFETCH
@register... | 45.671756 | 113 | 0.688952 | import tensorflow as tf
from baseline.tf.tfy import TRAIN_FLAG
from eight_mile.utils import listify
from baseline.utils import get_model_file, get_metric_cmp
from baseline.train import create_trainer, register_training_func
from baseline.tf.seq2seq.training.utils import to_tensors, SHUF_BUF_SZ, NUM_PREFETCH
@register... | true | true |
f76d80f5cd52bfdb132d90cdadc33971541bfbb4 | 3,359 | py | Python | app/app/settings.py | akkash/receipe-app-api | 4401fef3f62da3659d3ddef181c3ce0e51f0a03d | [
"MIT"
] | null | null | null | app/app/settings.py | akkash/receipe-app-api | 4401fef3f62da3659d3ddef181c3ce0e51f0a03d | [
"MIT"
] | null | null | null | app/app/settings.py | akkash/receipe-app-api | 4401fef3f62da3659d3ddef181c3ce0e51f0a03d | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 26.03876 | 91 | 0.683834 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '9=01-nw4hr6$%n6f!axxwaxds_m)m#fjxigsatgcondr$we==$'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
f76d8158dfc626bd6fc21f513cf7626f0839cb7d | 3,331 | py | Python | tests/methods/test_dino.py | fariasfc/solo-learn | f53ff40edbc7e96e06db5238d8c3a44f7b8965c1 | [
"MIT"
] | 3 | 2021-08-23T12:47:50.000Z | 2022-01-16T02:06:34.000Z | tests/methods/test_dino.py | damilu1/solo-learn | b75ba6faf5269b0849120bfb89593f9bc23e09bc | [
"MIT"
] | null | null | null | tests/methods/test_dino.py | damilu1/solo-learn | b75ba6faf5269b0849120bfb89593f9bc23e09bc | [
"MIT"
] | null | null | null | import argparse
import pytorch_lightning as pl
import torch
from pytorch_lightning import Trainer
from solo.methods import DINO
from .utils import DATA_KWARGS, gen_base_kwargs, gen_batch, prepare_dummy_dataloaders
def test_dino():
method_kwargs = {
"output_dim": 256,
"proj_hidden_dim": 2048,
... | 30.009009 | 98 | 0.654158 | import argparse
import pytorch_lightning as pl
import torch
from pytorch_lightning import Trainer
from solo.methods import DINO
from .utils import DATA_KWARGS, gen_base_kwargs, gen_batch, prepare_dummy_dataloaders
def test_dino():
method_kwargs = {
"output_dim": 256,
"proj_hidden_dim": 2048,
... | true | true |
f76d8168db8b8be2de7e9bab87d498d9a9ec2699 | 392 | py | Python | tests/test_pitch.py | uwase-diane/min_pitch | 514ab5da150244e900fd51b6563173a905ef4f29 | [
"Unlicense"
] | 1 | 2020-11-29T16:18:50.000Z | 2020-11-29T16:18:50.000Z | tests/test_pitch.py | uwase-diane/min_pitch | 514ab5da150244e900fd51b6563173a905ef4f29 | [
"Unlicense"
] | null | null | null | tests/test_pitch.py | uwase-diane/min_pitch | 514ab5da150244e900fd51b6563173a905ef4f29 | [
"Unlicense"
] | null | null | null | import unittest
from app.models import Pitch
Pitch = Pitch
class PitchTest(unittest.TestCase):
'''
Test Class to test the behaviour of the Pitch class
'''
def setUp(self):
'''
Set up method that will run before every Test
'''
self.new_pitch = Pitch()
def test_i... | 20.631579 | 57 | 0.635204 | import unittest
from app.models import Pitch
Pitch = Pitch
class PitchTest(unittest.TestCase):
def setUp(self):
self.new_pitch = Pitch()
def test_instance(self):
self.assertTrue(isinstance(self.new_pitch,Pitch)) | true | true |
f76d8306e30cf2838d6a15c2a3c6823519ba73ff | 216 | py | Python | src/upload_gym.py | 29ayush/simple_dqn | e34a0a14477b0feea8609596f880f7cbeaf5c61b | [
"MIT"
] | 767 | 2015-09-23T15:41:01.000Z | 2022-01-23T06:57:59.000Z | src/upload_gym.py | 29ayush/simple_dqn | e34a0a14477b0feea8609596f880f7cbeaf5c61b | [
"MIT"
] | 55 | 2015-10-08T14:31:37.000Z | 2020-02-19T04:27:25.000Z | src/upload_gym.py | 29ayush/simple_dqn | e34a0a14477b0feea8609596f880f7cbeaf5c61b | [
"MIT"
] | 214 | 2015-10-03T01:24:50.000Z | 2022-03-11T16:28:07.000Z | import argparse
import gym
parser = argparse.ArgumentParser()
parser.add_argument("results_folder")
parser.add_argument("--api_key")
args = parser.parse_args()
gym.upload(args.results_folder, api_key=args.api_key)
| 21.6 | 53 | 0.800926 | import argparse
import gym
parser = argparse.ArgumentParser()
parser.add_argument("results_folder")
parser.add_argument("--api_key")
args = parser.parse_args()
gym.upload(args.results_folder, api_key=args.api_key)
| true | true |
f76d8345ac820c58115eebf3d7788753f5400347 | 1,074 | py | Python | #29. Divide Two Integers.py | medisean/leetcode | f218fb738fb2b57f5eea3795a0a02cf495561465 | [
"MIT"
] | null | null | null | #29. Divide Two Integers.py | medisean/leetcode | f218fb738fb2b57f5eea3795a0a02cf495561465 | [
"MIT"
] | null | null | null | #29. Divide Two Integers.py | medisean/leetcode | f218fb738fb2b57f5eea3795a0a02cf495561465 | [
"MIT"
] | null | null | null | '''
Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.
Return the quotient after dividing dividend by divisor.
The integer division should truncate toward zero.
Example 1:
Input: dividend = 10, divisor = 3
Output: 3
Example 2:
Input: dividend = 7, ... | 29.833333 | 242 | 0.701117 | class Solution:
def divide(self, dividend: int, divisor: int) -> int:
twoPower30 = 2 << 30
maxInt = twoPower30 - 1
minInt = -twoPower30
result = int(dividend / divisor)
if result < minInt or result > maxInt:
return maxInt
return result
if __name__ == "__m... | true | true |
f76d839dc0f12d5f3955097e6f1c55f2e37caec2 | 15,323 | py | Python | virt_backup/backups/pending.py | arkadiam/virt-backup | b3e8703ae3ab0f792f5d68913ecf5e7270acea46 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | virt_backup/backups/pending.py | arkadiam/virt-backup | b3e8703ae3ab0f792f5d68913ecf5e7270acea46 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | virt_backup/backups/pending.py | arkadiam/virt-backup | b3e8703ae3ab0f792f5d68913ecf5e7270acea46 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import arrow
import json
import libvirt
import logging
import lxml.etree
import os
import subprocess
import tarfile
import virt_backup
from virt_backup.backups.packagers import ReadBackupPackagers, WriteBackupPackagers
from virt_backup.compat_layers.pending_info import (
convert as compat_convert_pending_info,
)
f... | 35.306452 | 87 | 0.613848 | import arrow
import json
import libvirt
import logging
import lxml.etree
import os
import subprocess
import tarfile
import virt_backup
from virt_backup.backups.packagers import ReadBackupPackagers, WriteBackupPackagers
from virt_backup.compat_layers.pending_info import (
convert as compat_convert_pending_info,
)
f... | true | true |
f76d83b0f64a3fe6392946825003cc03fe21f414 | 1,368 | py | Python | pinax/teams/context_urls.py | passiv/pinax-teams | d27004a2b3f88dec030c197d47c448d5852ae2ae | [
"MIT"
] | null | null | null | pinax/teams/context_urls.py | passiv/pinax-teams | d27004a2b3f88dec030c197d47c448d5852ae2ae | [
"MIT"
] | null | null | null | pinax/teams/context_urls.py | passiv/pinax-teams | d27004a2b3f88dec030c197d47c448d5852ae2ae | [
"MIT"
] | null | null | null | # include these urls instead of urls.py if you are using the WSGI + Django middlewares
# to set request.team, manually hooking up List/Create views as well as the accept/reject
from django.urls import path
from . import views
app_name = "pinax_teams"
urlpatterns = [
# team specific
path('detail/', views.te... | 50.666667 | 119 | 0.72076 |
from django.urls import path
from . import views
app_name = "pinax_teams"
urlpatterns = [
path('detail/', views.team_detail, name="team_detail"),
path('join/', views.team_join, name="team_join"),
path('leave/', views.team_leave, name="team_leave"),
path('apply/', views.team_apply, name="team_ap... | true | true |
f76d84116a301a52fed48fd2622e45275523f0cf | 373 | py | Python | Algorithms/ArmstrongNumber.py | jaydulera/data-structure-and-algorithms | abc2d67871add6f314888a72215ff3a2da2dc6e1 | [
"Apache-2.0"
] | 53 | 2020-09-26T19:44:33.000Z | 2021-09-30T20:38:52.000Z | Algorithms/ArmstrongNumber.py | jaydulera/data-structure-and-algorithms | abc2d67871add6f314888a72215ff3a2da2dc6e1 | [
"Apache-2.0"
] | 197 | 2020-08-25T18:13:56.000Z | 2021-06-19T07:26:19.000Z | Algorithms/ArmstrongNumber.py | jaydulera/data-structure-and-algorithms | abc2d67871add6f314888a72215ff3a2da2dc6e1 | [
"Apache-2.0"
] | 204 | 2020-08-24T09:21:02.000Z | 2022-02-13T06:13:42.000Z | def check_armstrong_num(n):
sum_of_cubes = 0
orig_n = n
while n > 0:
digit = n%10
sum_of_cubes = sum_of_cubes + pow(digit, 3)
n = n//10
if sum_of_cubes == orig_n:
return "Is an Armstrong Number"
else:
return "Not an Armstrong Number"
number = int(input()... | 21.941176 | 51 | 0.605898 | def check_armstrong_num(n):
sum_of_cubes = 0
orig_n = n
while n > 0:
digit = n%10
sum_of_cubes = sum_of_cubes + pow(digit, 3)
n = n//10
if sum_of_cubes == orig_n:
return "Is an Armstrong Number"
else:
return "Not an Armstrong Number"
number = int(input()... | true | true |
f76d84fa6da8cd89653cf28fa498a495bb85579c | 757 | py | Python | LabsDone/lab11_trees.py | jeremyprice/PythonForDevs | 5ec2690aedbaa6243cd4e251e9d31ff696ca0a82 | [
"MIT"
] | 2 | 2016-02-09T15:18:20.000Z | 2016-11-04T10:25:41.000Z | LabsDone/lab11_trees.py | jeremyprice/PythonForDevs | 5ec2690aedbaa6243cd4e251e9d31ff696ca0a82 | [
"MIT"
] | null | null | null | LabsDone/lab11_trees.py | jeremyprice/PythonForDevs | 5ec2690aedbaa6243cd4e251e9d31ff696ca0a82 | [
"MIT"
] | 3 | 2016-02-09T15:19:18.000Z | 2019-03-08T23:32:51.000Z | """
This program reads all of the tree heights in the trees.dat file and
computes the number of trees, the average height, the shortest tree and
the tallest tree. Only built-in functions are used in the calculations.
"""
trees = []
fin = open('/home/student/pydata/trees.dat')
# fin = open('c:/pydata/trees.dat'... | 26.103448 | 72 | 0.667107 | """
This program reads all of the tree heights in the trees.dat file and
computes the number of trees, the average height, the shortest tree and
the tallest tree. Only built-in functions are used in the calculations.
"""
trees = []
fin = open('/home/student/pydata/trees.dat')
for i in fin:
try:
h... | false | true |
f76d855625c4b1310800633b1b411057267d3336 | 12,290 | py | Python | time/dates.py | claywahlstrom/clay | 7b157b089966f6aa85b354a22691a194baeb6d84 | [
"BSD-2-Clause"
] | 2 | 2019-05-04T09:32:15.000Z | 2021-02-08T08:38:23.000Z | time/dates.py | claywahlstrom/clay | 7b157b089966f6aa85b354a22691a194baeb6d84 | [
"BSD-2-Clause"
] | null | null | null | time/dates.py | claywahlstrom/clay | 7b157b089966f6aa85b354a22691a194baeb6d84 | [
"BSD-2-Clause"
] | null | null | null |
"""
Dates
"""
import datetime as dt
from clay.time.base import BaseDateTimeRange
# date formats
MDY_FMT = '%m/%d/%Y'
MDY_DASH_FMT = '%m-%d-%Y'
YMD_FMT = '%Y/%m/%d'
YMD_DASH_FMT = '%Y-%m-%d'
# days of the week
MONDAY = dt.date(2019, 4, 22)
TUESDAY = dt.date(2019, 4, 23)
WEDNESDAY = dt.date(2019, 4, 24)
THURSDAY = ... | 30.879397 | 105 | 0.544508 |
import datetime as dt
from clay.time.base import BaseDateTimeRange
MDY_FMT = '%m/%d/%Y'
MDY_DASH_FMT = '%m-%d-%Y'
YMD_FMT = '%Y/%m/%d'
YMD_DASH_FMT = '%Y-%m-%d'
MONDAY = dt.date(2019, 4, 22)
TUESDAY = dt.date(2019, 4, 23)
WEDNESDAY = dt.date(2019, 4, 24)
THURSDAY = dt.date(2019, 4, 25)
FRIDAY = dt.date(2019, 4, 26... | true | true |
f76d856157f93205885a25810469c297bea07d41 | 43,103 | py | Python | morpheus/classifier.py | preller/morpheus | ba10271c6ace5aff3b35509ab5fbf42bcd6750b6 | [
"MIT"
] | 44 | 2019-06-28T04:29:02.000Z | 2022-03-03T01:29:26.000Z | morpheus/classifier.py | preller/morpheus | ba10271c6ace5aff3b35509ab5fbf42bcd6750b6 | [
"MIT"
] | 27 | 2019-01-07T22:56:04.000Z | 2022-02-18T15:44:59.000Z | morpheus/classifier.py | preller/morpheus | ba10271c6ace5aff3b35509ab5fbf42bcd6750b6 | [
"MIT"
] | 8 | 2019-06-28T16:25:08.000Z | 2022-03-07T12:16:57.000Z | # MIT License
# Copyright 2018 Ryan Hausen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publis... | 36.714651 | 110 | 0.53987 | import os
import time
import json
from subprocess import Popen
from typing import Iterable, List, Tuple, Callable, Dict, Union
import imageio
import numpy as np
import tensorflow.compat.v1 as tf
from astropy.io import fits
from matplotlib.colors import hsv_to_rgb
from scipy import ndimage as ndi
from skimage.feature i... | true | true |
f76d860f0176104549e1672e60fb4ddf641f9d5d | 590 | py | Python | aws/python/ec2_control.py | honux77/practice | f92481740190b20ef352135c392c8a9bea58dcc7 | [
"MIT"
] | 152 | 2015-01-12T07:40:53.000Z | 2022-03-20T15:51:35.000Z | aws/python/ec2_control.py | Brielle-Choi/practice | f92481740190b20ef352135c392c8a9bea58dcc7 | [
"MIT"
] | 11 | 2015-01-12T07:45:54.000Z | 2021-09-02T02:46:52.000Z | aws/python/ec2_control.py | Brielle-Choi/practice | f92481740190b20ef352135c392c8a9bea58dcc7 | [
"MIT"
] | 32 | 2015-01-12T09:10:04.000Z | 2022-03-02T09:18:17.000Z | import boto3
region = 'ap-northeast-1'
KILLTAG = 'temp'
ec2 = boto3.resource('ec2', region)
instances = ec2.instances.all()
for instance in instances:
# print(instance.id, instance.instance_type, instance.state, instance.tags)
tags = instance.tags
state = instance.state['Name']
found = False
name = ... | 29.5 | 79 | 0.644068 | import boto3
region = 'ap-northeast-1'
KILLTAG = 'temp'
ec2 = boto3.resource('ec2', region)
instances = ec2.instances.all()
for instance in instances:
tags = instance.tags
state = instance.state['Name']
found = False
name = (item for item in tags if item['Key'] == 'Name').next()
if KILLTAG in na... | true | true |
f76d8800eefdb3a68f31f48b894e5b98db94e901 | 518 | py | Python | utils/model_info.py | DAMONYLY/General_detection | c6aa16a4369c12771c392abb297f1bb5fbb7f6de | [
"MIT"
] | 2 | 2022-01-09T02:45:20.000Z | 2022-01-09T03:04:10.000Z | utils/model_info.py | DAMONYLY/General_detection | c6aa16a4369c12771c392abb297f1bb5fbb7f6de | [
"MIT"
] | 2 | 2021-12-03T06:27:49.000Z | 2022-01-05T09:42:58.000Z | utils/model_info.py | DAMONYLY/General_detection | c6aa16a4369c12771c392abb297f1bb5fbb7f6de | [
"MIT"
] | null | null | null | from copy import deepcopy
import torch
from thop import profile
def get_model_info(model, tsize):
if isinstance(tsize, list):
tsize = tsize[0]
stride = 64
img = torch.zeros((1, 3, stride, stride), device=next(model.parameters()).device)
flops, params = profile(deepcopy(model), inputs=(img,), v... | 28.777778 | 85 | 0.648649 | from copy import deepcopy
import torch
from thop import profile
def get_model_info(model, tsize):
if isinstance(tsize, list):
tsize = tsize[0]
stride = 64
img = torch.zeros((1, 3, stride, stride), device=next(model.parameters()).device)
flops, params = profile(deepcopy(model), inputs=(img,), v... | true | true |
f76d89b779ee02628244b0af784832e93d355a18 | 1,226 | py | Python | setup.py | cta-observatory/divtel | 9034b7282282b853abb5cbbb2d7bf42fdf47caeb | [
"MIT"
] | null | null | null | setup.py | cta-observatory/divtel | 9034b7282282b853abb5cbbb2d7bf42fdf47caeb | [
"MIT"
] | null | null | null | setup.py | cta-observatory/divtel | 9034b7282282b853abb5cbbb2d7bf42fdf47caeb | [
"MIT"
] | 1 | 2022-03-01T20:53:20.000Z | 2022-03-01T20:53:20.000Z | #!/usr/bin/env python
# Licensed under an MIT license - see LICENSE
from setuptools import setup, find_packages
from pathlib import Path
## read __version__
with open(Path(__file__).parent.absolute().joinpath('divtel/version.py')) as f:
exec(f.read())
setup(name='divtel',
version=__version__,
descr... | 34.055556 | 96 | 0.597064 |
from setuptools import setup, find_packages
from pathlib import Path
with open(Path(__file__).parent.absolute().joinpath('divtel/version.py')) as f:
exec(f.read())
setup(name='divtel',
version=__version__,
description="Divergent pointing mode for Imaging Atmospheric Cherenkov Telescopes arrays",
... | true | true |
f76d8aaa7b17479955098b41aa0d21ae9ce2de3e | 5,009 | py | Python | wrappers/python/docs/source/conf.py | vvalkonen/backend-apis | 769a45e6a90a87ab5af78e9a50ebde12f4821b99 | [
"Apache-2.0"
] | 9 | 2019-12-20T06:41:37.000Z | 2020-09-21T03:34:47.000Z | wrappers/python/docs/source/conf.py | vvalkonen/backend-apis | 769a45e6a90a87ab5af78e9a50ebde12f4821b99 | [
"Apache-2.0"
] | 38 | 2019-05-09T09:55:01.000Z | 2022-01-04T10:52:46.000Z | wrappers/python/docs/source/conf.py | vvalkonen/backend-apis | 769a45e6a90a87ab5af78e9a50ebde12f4821b99 | [
"Apache-2.0"
] | 13 | 2019-10-29T19:51:08.000Z | 2021-11-25T15:08:02.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 32.953947 | 81 | 0.67798 |
import os
import sys
import subprocess
_here = os.path.abspath(os.path.dirname(__file__))
_library_root = os.path.abspath(os.path.join(_here, "../.."))
sys.path.insert(0, _library_root)
def run_proto_gen(self):
cmds = ["./utils/pull_protos.sh", "./utils/compile_protos.sh"]
for cmd in cmds:
prin... | true | true |
f76d8abb05bff781da7d449b99852d49bf4ae7f7 | 1,393 | py | Python | api/nhlapi/util.py | rosszm/hashmarks | 133d2af5f149247367dc52678b3a56461de79b9d | [
"MIT"
] | null | null | null | api/nhlapi/util.py | rosszm/hashmarks | 133d2af5f149247367dc52678b3a56461de79b9d | [
"MIT"
] | 9 | 2022-03-01T04:35:26.000Z | 2022-03-31T22:59:28.000Z | api/nhlapi/util.py | rosszm/hashmarks | 133d2af5f149247367dc52678b3a56461de79b9d | [
"MIT"
] | null | null | null | """
This module contains utility functions for the NHL API proxy server.
"""
from fastapi import Request, Response, HTTPException
import httpx
def forward_request(api_url: str, request: Request) -> Response:
"""
Forwards a request to an API at the given url. Requires that the request has a path parameter
... | 32.395349 | 98 | 0.687006 |
from fastapi import Request, Response, HTTPException
import httpx
def forward_request(api_url: str, request: Request) -> Response:
endpoint = request.path_params.get("endpoint")
assert endpoint != None, "forward_request: request must have the path parameter 'endpoint'"
response = httpx.get(f"{api_url}/... | true | true |
f76d8b7028e681070ecd2fca499a17344ce61304 | 2,398 | py | Python | setup.py | mbarkhau/lexid | 5b0e0cad39e826d89f79154e338ca96ae48259a7 | [
"MIT"
] | null | null | null | setup.py | mbarkhau/lexid | 5b0e0cad39e826d89f79154e338ca96ae48259a7 | [
"MIT"
] | 1 | 2021-04-02T16:18:18.000Z | 2021-04-02T19:43:14.000Z | setup.py | mbarkhau/lexid | 5b0e0cad39e826d89f79154e338ca96ae48259a7 | [
"MIT"
] | 2 | 2021-03-06T05:35:31.000Z | 2021-04-02T17:02:07.000Z | # This file is part of the lexid project
# https://github.com/mbarkhau/lexid
#
# Copyright (c) 2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License
# SPDX-License-Identifier: MIT
import os
import sys
import setuptools
def project_path(*sub_paths):
project_dirpath = os.path.abspath(os.path.dirname(__file__))
... | 28.891566 | 77 | 0.679316 |
import os
import sys
import setuptools
def project_path(*sub_paths):
project_dirpath = os.path.abspath(os.path.dirname(__file__))
return os.path.join(project_dirpath, *sub_paths)
def read(*sub_paths):
with open(project_path(*sub_paths), mode="rb") as fh:
return fh.read().decode("utf-8")
insta... | true | true |
f76d8be64b4e6581ada6a1914dd1534bb32b7d13 | 136,057 | py | Python | clib/mininet_test_base.py | mwutzke/faucet | 2642d72b6123f81c873c65320015245f2440e39d | [
"Apache-2.0"
] | null | null | null | clib/mininet_test_base.py | mwutzke/faucet | 2642d72b6123f81c873c65320015245f2440e39d | [
"Apache-2.0"
] | null | null | null | clib/mininet_test_base.py | mwutzke/faucet | 2642d72b6123f81c873c65320015245f2440e39d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Base class for all FAUCET unit tests."""
# pylint: disable=missing-function-docstring
# pylint: disable=too-many-arguments
# pylint: disable=too-many-lines
from functools import partial
import collections
import copy
import glob
import ipaddress
import json
import os
import random
import re... | 43.524312 | 107 | 0.592252 |
from functools import partial
import collections
import copy
import glob
import ipaddress
import json
import os
import random
import re
import shutil
import string
import subprocess
import tempfile
import time
import unittest
import yaml
import netaddr
import requests
from ryu.ofproto import ofproto_v1_3 as ofp
f... | true | true |
f76d8c03f8c08f1f4c8c97bfe82d04024382e1ba | 781 | py | Python | migrations/versions/8bd5fd537d97_.py | danisaleem/Flask_App | bb3709fedd1cb40d36f2b91964b54875c55e9091 | [
"MIT"
] | null | null | null | migrations/versions/8bd5fd537d97_.py | danisaleem/Flask_App | bb3709fedd1cb40d36f2b91964b54875c55e9091 | [
"MIT"
] | 1 | 2020-05-14T16:31:48.000Z | 2021-04-27T01:19:46.000Z | migrations/versions/8bd5fd537d97_.py | danisaleem/Flask_App | bb3709fedd1cb40d36f2b91964b54875c55e9091 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 8bd5fd537d97
Revises: 492842fc3ad0
Create Date: 2020-03-26 16:11:46.839537
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8bd5fd537d97'
down_revision = '492842fc3ad0'
branch_labels = None
depends_on = None
def upgrade():
# ... | 25.193548 | 86 | 0.690141 | from alembic import op
import sqlalchemy as sa
revision = '8bd5fd537d97'
down_revision = '492842fc3ad0'
branch_labels = None
depends_on = None
def upgrade():
op.add_column('user', sa.Column('about_me', sa.String(length=140), nullable=True))
op.add_column('user', sa.Column('last_seen', sa.DateTime(), nul... | true | true |
f76d8ccb38964a9f50055c211c162133840fa20e | 1,680 | py | Python | ooobuild/cssdyn/sdb/tools/__init__.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/cssdyn/sdb/tools/__init__.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/cssdyn/sdb/tools/__init__.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 56 | 96 | 0.809524 | from ....dyn.sdb.tools.composition_type import CompositionType as CompositionType
from ....dyn.sdb.tools.composition_type import CompositionTypeEnum as CompositionTypeEnum
from ....dyn.sdb.tools.connection_tools import ConnectionTools as ConnectionTools
from ....dyn.sdb.tools.x_connection_supplier import XConnectionSup... | true | true |
f76d8da1bb752fe4b1170e3c7ccbd9a3ef077a4a | 50,128 | py | Python | venv/Lib/site-packages/sklearn/decomposition/_nmf.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sklearn/decomposition/_nmf.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sklearn/decomposition/_nmf.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | """ Non-negative matrix factorization.
"""
# Author: Vlad Niculae
# Lars Buitinck
# Mathieu Blondel <mathieu@mblondel.org>
# Tom Dupre la Tour
# License: BSD 3 clause
import numbers
import numpy as np
import scipy.sparse as sp
import time
import warnings
from math import sqrt
fr... | 35.985642 | 80 | 0.569722 |
import numbers
import numpy as np
import scipy.sparse as sp
import time
import warnings
from math import sqrt
from ._cdnmf_fast import _update_cdnmf_fast
from .._config import config_context
from ..base import BaseEstimator, TransformerMixin
from ..exceptions import ConvergenceWarning
from ..utils import ... | true | true |
f76d8db102503205841ae5c15b19e05dc493aa0c | 8,134 | py | Python | Pokelog/Pokelog.py | Kevinmsouza/Pokelog | 698c2b0c2c8881207399bd41c5b095b9657e4bc9 | [
"MIT"
] | 1 | 2021-06-06T01:10:14.000Z | 2021-06-06T01:10:14.000Z | Pokelog/Pokelog.py | Kevinmsouza/Pokelog | 698c2b0c2c8881207399bd41c5b095b9657e4bc9 | [
"MIT"
] | null | null | null | Pokelog/Pokelog.py | Kevinmsouza/Pokelog | 698c2b0c2c8881207399bd41c5b095b9657e4bc9 | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
tipos = ['Aço', 'Água', 'Dragão', 'Elétrico','Fada','Fantasma','Fogo',
'Gelo','Inseto', 'Lutador', 'Normal','Pedra','Planta','Psiquico',
'Sombrio','Terrestre','Venenoso','Voador']
tipos_autolog = ['Steel', 'Water', 'Dragon', 'Electric','Fairy','Ghost','F... | 40.467662 | 135 | 0.557045 | import requests
from bs4 import BeautifulSoup
tipos = ['Aço', 'Água', 'Dragão', 'Elétrico','Fada','Fantasma','Fogo',
'Gelo','Inseto', 'Lutador', 'Normal','Pedra','Planta','Psiquico',
'Sombrio','Terrestre','Venenoso','Voador']
tipos_autolog = ['Steel', 'Water', 'Dragon', 'Electric','Fairy','Ghost','F... | true | true |
f76d8f9ef807a418d1264bc35744ff76d53d032d | 2,447 | py | Python | src/COVID-19-Italy.py | tommasobonomo/covid19-italy | cc063f93871426a885c183682ddc930d9c9be549 | [
"MIT"
] | 26 | 2020-03-11T12:20:37.000Z | 2021-11-08T10:45:29.000Z | src/COVID-19-Italy.py | tommasobonomo/covid19-italy | cc063f93871426a885c183682ddc930d9c9be549 | [
"MIT"
] | 14 | 2020-03-15T15:50:24.000Z | 2020-11-30T22:40:37.000Z | src/COVID-19-Italy.py | tommasobonomo/covid19-italy | cc063f93871426a885c183682ddc930d9c9be549 | [
"MIT"
] | 11 | 2020-03-11T17:41:56.000Z | 2021-04-03T09:54:24.000Z | import streamlit as st
import pandas as pd
from gettext import translation, NullTranslations
from typing import Dict, Callable
from utils import get_data, dataframe_translator
from trends import line_plots
from trajectory import trajectory_cases
from maps import choropleth_maps
data = get_data()
st.sidebar.title("L... | 30.209877 | 155 | 0.693502 | import streamlit as st
import pandas as pd
from gettext import translation, NullTranslations
from typing import Dict, Callable
from utils import get_data, dataframe_translator
from trends import line_plots
from trajectory import trajectory_cases
from maps import choropleth_maps
data = get_data()
st.sidebar.title("L... | true | true |
f76d90094cbf6395bf88baaf3f2c7323ab64f0bc | 14,890 | py | Python | lib/services/vserver/ncloud_vserver/model/product.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 12 | 2018-11-20T04:30:49.000Z | 2021-11-09T12:34:26.000Z | lib/services/vserver/ncloud_vserver/model/product.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 1 | 2019-01-24T15:56:15.000Z | 2019-05-31T07:56:55.000Z | lib/services/vserver/ncloud_vserver/model/product.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 6 | 2018-06-29T03:45:50.000Z | 2022-03-18T01:51:45.000Z | # coding: utf-8
"""
vserver
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from ncloud_vserver.model.common_code import CommonCode # noqa: F401,E501
class Product(object):
"""NOTE: This class is auto generated by the swagge... | 29.426877 | 370 | 0.619946 |
import pprint
import re
import six
from ncloud_vserver.model.common_code import CommonCode
class Product(object):
swagger_types = {
'product_code': 'str',
'product_name': 'str',
'product_type': 'CommonCode',
'product_description': 'str',
'infra_resource_type': 'Comm... | true | true |
f76d9012f789fd260777fb2efab0b632542f44b4 | 395 | py | Python | packages/python/plotly/plotly/validators/scatterternary/_ids.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/scatterternary/_ids.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/scatterternary/_ids.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="ids", parent_name="scatterternary", **kwargs):
super(IdsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 32.916667 | 82 | 0.670886 | import _plotly_utils.basevalidators
class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="ids", parent_name="scatterternary", **kwargs):
super(IdsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f76d90eb4c775a878bd9a8cfcd0617b231163950 | 173 | py | Python | boa3_test/test_sc/interop_test/blockchain/GetTransactionFromBlockMismatchedType.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/interop_test/blockchain/GetTransactionFromBlockMismatchedType.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/interop_test/blockchain/GetTransactionFromBlockMismatchedType.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from boa3.builtin.interop.blockchain import Transaction, get_transaction_from_block
def main() -> Transaction:
return get_transaction_from_block('height', 'tx_index')
| 28.833333 | 83 | 0.803468 | from boa3.builtin.interop.blockchain import Transaction, get_transaction_from_block
def main() -> Transaction:
return get_transaction_from_block('height', 'tx_index')
| true | true |
f76d91285b21c770160537968636dee6a7bd8962 | 1,499 | py | Python | tests/urlconfs/url_versioning.py | johnny-prnd/drf-yasg | 5a943250e62ac1ecab1faa3155c5f87ab68367a3 | [
"BSD-3-Clause"
] | 1 | 2019-10-31T12:13:21.000Z | 2019-10-31T12:13:21.000Z | tests/urlconfs/url_versioning.py | johnny-prnd/drf-yasg | 5a943250e62ac1ecab1faa3155c5f87ab68367a3 | [
"BSD-3-Clause"
] | 4 | 2021-06-28T20:54:50.000Z | 2022-03-29T18:26:22.000Z | tests/urlconfs/url_versioning.py | johnny-prnd/drf-yasg | 5a943250e62ac1ecab1faa3155c5f87ab68367a3 | [
"BSD-3-Clause"
] | 1 | 2020-05-29T08:55:51.000Z | 2020-05-29T08:55:51.000Z | from django.conf.urls import url
from rest_framework import fields, generics, versioning
from snippets.models import Snippet
from snippets.serializers import SnippetSerializer
from testproj.urls import SchemaView, required_urlpatterns
class SnippetSerializerV2(SnippetSerializer):
v2field = fields.IntegerField(he... | 30.591837 | 120 | 0.723816 | from django.conf.urls import url
from rest_framework import fields, generics, versioning
from snippets.models import Snippet
from snippets.serializers import SnippetSerializer
from testproj.urls import SchemaView, required_urlpatterns
class SnippetSerializerV2(SnippetSerializer):
v2field = fields.IntegerField(he... | true | true |
f76d92a66967bdc487ad29e92f07556daa77e396 | 894 | py | Python | services/web/apps/crm/supplierprofile/views.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | services/web/apps/crm/supplierprofile/views.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | services/web/apps/crm/supplierprofile/views.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# crm.supplierprofile application
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ------------------------------------------------... | 33.111111 | 71 | 0.55481 |
from noc.lib.app.extdocapplication import ExtDocApplication
from noc.crm.models.supplierprofile import SupplierProfile
from noc.core.translation import ugettext as _
class SupplierProfileApplication(ExtDocApplication):
title = _("Supplier Profile")
menu = [_("Setup"), _("Supplier Profiles")]
model = Sup... | true | true |
f76d941fd9448950cc5666be910b8f4e6aa026f0 | 757 | py | Python | slave/__main__.py | bufgix/slave | 9c71035d06e1a714db43ac7c4503a807f0baa185 | [
"MIT"
] | 8 | 2019-06-16T17:03:28.000Z | 2021-10-10T19:48:34.000Z | slave/__main__.py | bufgix/slave | 9c71035d06e1a714db43ac7c4503a807f0baa185 | [
"MIT"
] | 4 | 2019-08-22T23:28:07.000Z | 2021-02-02T22:15:29.000Z | slave/__main__.py | bufgix/slave | 9c71035d06e1a714db43ac7c4503a807f0baa185 | [
"MIT"
] | 2 | 2021-04-02T21:00:15.000Z | 2021-04-03T07:02:26.000Z | from subprocess import Popen, PIPE
import pathlib
import sys
def create_executable(filename: str = 'bot.py'):
bot_source = pathlib.Path().cwd() / filename
print(f"[i] Source: {bot_source}")
print("[i] Creating executable file...")
proc = Popen(['pyinstaller',
'-F', '-w', '--clean',
... | 29.115385 | 83 | 0.577279 | from subprocess import Popen, PIPE
import pathlib
import sys
def create_executable(filename: str = 'bot.py'):
bot_source = pathlib.Path().cwd() / filename
print(f"[i] Source: {bot_source}")
print("[i] Creating executable file...")
proc = Popen(['pyinstaller',
'-F', '-w', '--clean',
... | true | true |
f76d945463dc2837848f5d361949c1936888c446 | 433 | py | Python | scripts/score/dynamic_call/set_wallet_owners_required.py | ICONationDevTeam/ICONSafe-SCORE | a02640f3bbbf71c633773a87b99d354e2466c26d | [
"Apache-2.0"
] | 2 | 2020-08-17T10:39:42.000Z | 2020-09-07T14:10:39.000Z | scripts/score/dynamic_call/set_wallet_owners_required.py | iconation/MultiSigWallet | a3dcea7fa182152e66f5cddaacebef8a7350c332 | [
"Apache-2.0"
] | null | null | null | scripts/score/dynamic_call/set_wallet_owners_required.py | iconation/MultiSigWallet | a3dcea7fa182152e66f5cddaacebef8a7350c332 | [
"Apache-2.0"
] | 2 | 2021-02-07T11:30:53.000Z | 2021-04-17T19:52:21.000Z | import json
import sys
if __name__ == '__main__':
network = sys.argv[1]
owners_required = sys.argv[2]
score_address_txt = "./config/" + network + "/score_address.txt"
call = json.loads(open("./calls/set_wallet_owners_required.json", "rb").read())
call["params"]["to"] = open(score_address_txt, "r"... | 27.0625 | 83 | 0.658199 | import json
import sys
if __name__ == '__main__':
network = sys.argv[1]
owners_required = sys.argv[2]
score_address_txt = "./config/" + network + "/score_address.txt"
call = json.loads(open("./calls/set_wallet_owners_required.json", "rb").read())
call["params"]["to"] = open(score_address_txt, "r"... | true | true |
f76d95b82ef895ca0e364395e18e49fca7b42707 | 11,509 | py | Python | scikit-learn-master/sklearn/utils/tests/test_utils.py | lqkweb/learnMLflow | 13c5decaebba95b1b90f92021be35e343b4764af | [
"Apache-2.0"
] | 2 | 2019-02-21T10:43:16.000Z | 2019-07-30T04:56:37.000Z | scikit-learn-master/sklearn/utils/tests/test_utils.py | lqkweb/learnMLflow | 13c5decaebba95b1b90f92021be35e343b4764af | [
"Apache-2.0"
] | null | null | null | scikit-learn-master/sklearn/utils/tests/test_utils.py | lqkweb/learnMLflow | 13c5decaebba95b1b90f92021be35e343b4764af | [
"Apache-2.0"
] | null | null | null | from itertools import chain, product
import warnings
import pytest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import (assert_equal, assert_raises,
assert_array_equal,
SkipTest, assert_raises_regex,
... | 35.853583 | 79 | 0.607438 | from itertools import chain, product
import warnings
import pytest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import (assert_equal, assert_raises,
assert_array_equal,
SkipTest, assert_raises_regex,
... | true | true |
f76d9643731f79b0013137143ff6478b6ec0d3a4 | 2,111 | py | Python | performanceanalytics/charts/boxplot.py | Karagul/PerformanceAnalytics | cfb88bf9dba5b691a3e3c00cdcede79ae2603fb8 | [
"MIT"
] | 38 | 2017-10-25T15:56:16.000Z | 2022-01-21T02:35:55.000Z | performanceanalytics/charts/boxplot.py | abdulroqeeb/PerformanceAnalytics | cfb88bf9dba5b691a3e3c00cdcede79ae2603fb8 | [
"MIT"
] | 2 | 2019-08-09T21:16:00.000Z | 2020-05-03T14:48:18.000Z | performanceanalytics/charts/boxplot.py | abdulroqeeb/PerformanceAnalytics | cfb88bf9dba5b691a3e3c00cdcede79ae2603fb8 | [
"MIT"
] | 18 | 2017-09-15T10:33:58.000Z | 2022-03-11T01:44:59.000Z | # MIT License
# Copyright (c) 2017 Jacob Bourne
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | 35.779661 | 87 | 0.714827 |
import matplotlib.pyplot as plt
def boxplot(data, manager_col=0, other_cols=None, **kwargs):
ax_cols = [manager_col]
if other_cols is not None:
for oc in other_cols:
ax_cols.append(oc)
df1 = data[data.columns[ax_cols]]
df1 = df1.ix[::, ::-1]
f = plt.figure(fig... | true | true |
f76d966bc9103cf2276a7dd85cfa712953723344 | 10,712 | py | Python | finalquest/main.py | akshajdwivedula/gameQuest | 28a12b88cd293a30c2940ed6351d682b66757116 | [
"MIT"
] | null | null | null | finalquest/main.py | akshajdwivedula/gameQuest | 28a12b88cd293a30c2940ed6351d682b66757116 | [
"MIT"
] | null | null | null | finalquest/main.py | akshajdwivedula/gameQuest | 28a12b88cd293a30c2940ed6351d682b66757116 | [
"MIT"
] | null | null | null | ###This file was altered/created by: Akshaj Dwivedula
# KidsCanCode - Game Development with Pygame video series
# Jumpy! (a platform game) - Part 2 and Part 5
# Video link: https://www.youtube.com/watch?v=8LRI0RLKyt0
# Player movement
# Copyright 2019 KidsCanCode LLC -/- All rights reserved.
#Citations: Some code was... | 45.777778 | 203 | 0.570202 |
#importing libraries from pythong - as feature provides shorthand for coding
import pygame as pg
from pygame.sprite import Group
import random as rand
#modularity - importng both the settings and the sprites file and the properties from said files
from settings import *
from sprites import *
import math
class Gam... | true | true |
f76d96f392635f96d020d8113efe7fa36edd5ee4 | 2,414 | py | Python | aliyun-python-sdk-voicenavigator/aliyunsdkvoicenavigator/request/v20180612/QueryConversationsRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-voicenavigator/aliyunsdkvoicenavigator/request/v20180612/QueryConversationsRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | 1 | 2020-05-31T14:51:47.000Z | 2020-05-31T14:51:47.000Z | aliyun-python-sdk-voicenavigator/aliyunsdkvoicenavigator/request/v20180612/QueryConversationsRequest.py | jia-jerry/aliyun-openapi-python-sdk | e90f3683a250cfec5b681b5f1d73a68f0dc9970d | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.029851 | 92 | 0.778376 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkvoicenavigator.endpoint import endpoint_data
class QueryConversationsRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'VoiceNavigator', '2018-06-12', 'QueryConversations','voicebot')
if hasattr(self, "endpoint_map"):
setattr(self, "... | true | true |
f76d973d729aa8d7e997b220eef2d109db5d8dff | 2,615 | py | Python | watchman/test/async/test_subscribe_async.py | 0xgpapad/watchman | 71ae8281ca0d583db7c2c8f057a489a86eded406 | [
"MIT"
] | 3 | 2022-02-10T10:48:36.000Z | 2022-02-21T23:18:10.000Z | watchman/test/async/test_subscribe_async.py | 0xgpapad/watchman | 71ae8281ca0d583db7c2c8f057a489a86eded406 | [
"MIT"
] | null | null | null | watchman/test/async/test_subscribe_async.py | 0xgpapad/watchman | 71ae8281ca0d583db7c2c8f057a489a86eded406 | [
"MIT"
] | 1 | 2022-02-06T10:29:46.000Z | 2022-02-06T10:29:46.000Z | #!/usr/bin/env python3
# vim:ts=4:sw=4:et:
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# no unicode literals
import os
import tempfile
import unittest
import AsyncWatchmanTestCase
... | 36.319444 | 85 | 0.650478 |
import os
import tempfile
import unittest
import AsyncWatchmanTestCase
class TestSubscribe(AsyncWatchmanTestCase.AsyncWatchmanTestCase):
@unittest.skipIf(os.name == "nt", "not supported on windows")
def test_subscribe(self):
root = tempfile.mkdtemp()
a_dir = os.path.join(root, "a")
... | true | true |
f76d975ba6fbfe09e65deee68beadd9a07ac3bcd | 1,826 | py | Python | PP4E-Examples-1.4/Examples/PP4E/Gui/MovingPics/movingpics_after.py | AngelLiang/PP4E | 3a7f63b366e1e4700b4d2524884696999a87ba9d | [
"MIT"
] | null | null | null | PP4E-Examples-1.4/Examples/PP4E/Gui/MovingPics/movingpics_after.py | AngelLiang/PP4E | 3a7f63b366e1e4700b4d2524884696999a87ba9d | [
"MIT"
] | null | null | null | PP4E-Examples-1.4/Examples/PP4E/Gui/MovingPics/movingpics_after.py | AngelLiang/PP4E | 3a7f63b366e1e4700b4d2524884696999a87ba9d | [
"MIT"
] | null | null | null | """
PyDraw-after: simple canvas paint program and object mover/animator
use widget.after scheduled events to implement object move loops, such
that more than one can be in motion at once without having to use threads;
this does moves in parallel, but seems to be slower than time.sleep version;
see also canvasDraw in To... | 39.695652 | 80 | 0.593647 |
from movingpics import *
class MovingPicsAfter(MovingPics):
def doMoves(self, delay, objectId, incrX, reptX, incrY, reptY):
if reptX:
self.canvas.move(objectId, incrX, 0)
reptX -= 1
else:
self.canvas.move(objectId, 0, incrY)
reptY -= 1
if not... | true | true |
f76d981ace26847622af1af4ce8bfcfdabe900e0 | 1,470 | py | Python | 04_fib/solution3_recursion.py | ilaydabozan/biofx_python | b7bef85dcf0b0a9e049f10a0766b9da20bf676c7 | [
"MIT"
] | 74 | 2020-12-18T16:04:31.000Z | 2022-03-02T09:05:54.000Z | 04_fib/solution3_recursion.py | ilaydabozan/biofx_python | b7bef85dcf0b0a9e049f10a0766b9da20bf676c7 | [
"MIT"
] | 6 | 2021-06-30T19:42:04.000Z | 2022-02-07T04:45:31.000Z | 04_fib/solution3_recursion.py | ilaydabozan/biofx_python | b7bef85dcf0b0a9e049f10a0766b9da20bf676c7 | [
"MIT"
] | 169 | 2020-11-06T19:44:36.000Z | 2022-03-30T08:38:42.000Z | #!/usr/bin/env python3
""" Calculate Fibonacci """
import argparse
from typing import NamedTuple
class Args(NamedTuple):
""" Command-line arguments """
generations: int
litter: int
# --------------------------------------------------
def get_args() -> Args:
""" Get command-line arguments """
p... | 25.344828 | 74 | 0.512245 |
import argparse
from typing import NamedTuple
class Args(NamedTuple):
generations: int
litter: int
def get_args() -> Args:
parser = argparse.ArgumentParser(
description='Calculate Fibonacci',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('gen',
... | true | true |
f76d9868f7f0b057cd99c1b5c4216a15fb118fd6 | 4,816 | py | Python | manhattan/tests/test_clientserver.py | cartlogic/manhattan | 069b5468baf3bc1f5faffe9bc90342254bad9a2d | [
"MIT"
] | 1 | 2020-06-07T23:43:14.000Z | 2020-06-07T23:43:14.000Z | manhattan/tests/test_clientserver.py | cartlogic/manhattan | 069b5468baf3bc1f5faffe9bc90342254bad9a2d | [
"MIT"
] | null | null | null | manhattan/tests/test_clientserver.py | cartlogic/manhattan | 069b5468baf3bc1f5faffe9bc90342254bad9a2d | [
"MIT"
] | 1 | 2018-03-03T16:13:50.000Z | 2018-03-03T16:13:50.000Z | from __future__ import absolute_import, division, print_function
import code
import os
import os.path
import sys
import time
from pprint import pformat
from threading import Event, Thread
from sqlalchemy import create_engine
from manhattan.server import Server, main as server_main, logging_config
from manhattan.clie... | 34.898551 | 79 | 0.596553 | from __future__ import absolute_import, division, print_function
import code
import os
import os.path
import sys
import time
from pprint import pformat
from threading import Event, Thread
from sqlalchemy import create_engine
from manhattan.server import Server, main as server_main, logging_config
from manhattan.clie... | true | true |
f76d98e4100ff95ab1f51bd2067551a643bd0f67 | 447 | py | Python | process/srl_subevent.py | CogComp/EventProcessTyping | 7f5c3a21ae82d7c9d5d4e82a3700acb89f087c07 | [
"MIT"
] | 8 | 2020-10-03T21:55:16.000Z | 2022-03-17T05:49:36.000Z | process/srl_subevent.py | CogComp/EventProcessTyping | 7f5c3a21ae82d7c9d5d4e82a3700acb89f087c07 | [
"MIT"
] | 1 | 2021-06-28T09:50:52.000Z | 2021-06-28T09:50:52.000Z | process/srl_subevent.py | CogComp/EventProcessTyping | 7f5c3a21ae82d7c9d5d4e82a3700acb89f087c07 | [
"MIT"
] | 4 | 2021-06-07T07:57:43.000Z | 2022-02-18T23:19:58.000Z | import tqdm, sklearn
import numpy as np
import os, time, sys
import pickle
from itertools import chain
if '../utils' not in sys.path:
sys.path.append('../utils')
from data import Data
def main():
data_bin, o_data_bin = '../run/seqVerbMC/data.bin', '../run/seqVerbMC/data_subsrl.bin'
data = Da... | 21.285714 | 91 | 0.64877 | import tqdm, sklearn
import numpy as np
import os, time, sys
import pickle
from itertools import chain
if '../utils' not in sys.path:
sys.path.append('../utils')
from data import Data
def main():
data_bin, o_data_bin = '../run/seqVerbMC/data.bin', '../run/seqVerbMC/data_subsrl.bin'
data = Da... | true | true |
f76d991fc3d812b5632a2e3088163e139852078a | 5,967 | py | Python | Cifras/base_64.py | GregorioFornetti/CriPython | 12b5bc64188de3a7c81d8f9d0a392f6edc7ac827 | [
"MIT"
] | 1 | 2020-05-17T03:00:18.000Z | 2020-05-17T03:00:18.000Z | Cifras/base_64.py | GregorioFornetti/Cripythongrafia | 12b5bc64188de3a7c81d8f9d0a392f6edc7ac827 | [
"MIT"
] | 1 | 2020-05-17T15:59:26.000Z | 2020-05-17T15:59:26.000Z | Cifras/base_64.py | GregorioFornetti/Cripythongrafia | 12b5bc64188de3a7c81d8f9d0a392f6edc7ac827 | [
"MIT"
] | null | null | null | import Cifras.bases_numericas as bases_numericas
import Cifras.utf8 as utf8
import dicionarios
dicionario_base_64 = {'000000': 'A', '000001': 'B', '000010': 'C', '000011': 'D', '000100': 'E',
'000101': 'F', '000110': 'G', '000111': 'H', '001000': 'I', '001001': 'J',
'001010'... | 53.756757 | 160 | 0.638847 | import Cifras.bases_numericas as bases_numericas
import Cifras.utf8 as utf8
import dicionarios
dicionario_base_64 = {'000000': 'A', '000001': 'B', '000010': 'C', '000011': 'D', '000100': 'E',
'000101': 'F', '000110': 'G', '000111': 'H', '001000': 'I', '001001': 'J',
'001010'... | true | true |
f76d992ce1b4d48f9d0cfddec73a4a8b61a5a437 | 340 | py | Python | backend/apis/users/urls.py | sango09/senasoft | d7e5b0fae620764b3af73955f7771dcee5746dfc | [
"MIT"
] | 1 | 2020-10-17T03:39:56.000Z | 2020-10-17T03:39:56.000Z | backend/apis/users/urls.py | sango09/senasoft | d7e5b0fae620764b3af73955f7771dcee5746dfc | [
"MIT"
] | null | null | null | backend/apis/users/urls.py | sango09/senasoft | d7e5b0fae620764b3af73955f7771dcee5746dfc | [
"MIT"
] | null | null | null | """URLs de usuarios"""
# Django
from django.urls import include, path
# Django REST Framework
from rest_framework.routers import DefaultRouter
# View
from .views import users as user_views
router = DefaultRouter()
router.register(r'users', user_views.UserViewSet, basename='users')
urlpatterns = [
path('', incl... | 18.888889 | 67 | 0.75 |
from django.urls import include, path
from rest_framework.routers import DefaultRouter
from .views import users as user_views
router = DefaultRouter()
router.register(r'users', user_views.UserViewSet, basename='users')
urlpatterns = [
path('', include(router.urls))
]
| true | true |
f76d99d232407c1d4f7bfac8c5ab7ac0f4c4d2f7 | 8,209 | py | Python | object_detector/mrcnn/config.py | KDD2022-MSCMT/MSCMT | 6a3e1e6230aa519a57345f6dbb0731b3ed6fe1ce | [
"MIT"
] | null | null | null | object_detector/mrcnn/config.py | KDD2022-MSCMT/MSCMT | 6a3e1e6230aa519a57345f6dbb0731b3ed6fe1ce | [
"MIT"
] | null | null | null | object_detector/mrcnn/config.py | KDD2022-MSCMT/MSCMT | 6a3e1e6230aa519a57345f6dbb0731b3ed6fe1ce | [
"MIT"
] | null | null | null |
import math
import numpy as np
# Base Configuration Class
# Don't use this class directly. Instead, sub-class it and override
# the configurations you need to change.
class Config(object):
"""Base configuration class. For custom configurations, create a
sub-class that inherits from this one and override pr... | 39.466346 | 84 | 0.68498 |
import math
import numpy as np
# the configurations you need to change.
class Config(object):
# Name the configurations. For example, 'COCO', 'Experiment 3', ...etc.
# Useful if your code needs to do things differently depending on which
# experiment is running.
NAME = None # Override in sub-class... | true | true |
f76d99fc7f0d426183b63f7169e565fb1319b868 | 4,465 | py | Python | pySDC/playgrounds/Boris/spiraling_particle_ProblemClass.py | janEbert/pySDC | 167d78c4118bc3a5a446ec973fe65fb35db94471 | [
"BSD-2-Clause"
] | null | null | null | pySDC/playgrounds/Boris/spiraling_particle_ProblemClass.py | janEbert/pySDC | 167d78c4118bc3a5a446ec973fe65fb35db94471 | [
"BSD-2-Clause"
] | null | null | null | pySDC/playgrounds/Boris/spiraling_particle_ProblemClass.py | janEbert/pySDC | 167d78c4118bc3a5a446ec973fe65fb35db94471 | [
"BSD-2-Clause"
] | 1 | 2021-07-27T11:44:54.000Z | 2021-07-27T11:44:54.000Z |
import numpy as np
from pySDC.core.Problem import ptype
from pySDC.implementations.datatype_classes.particles import particles, fields, acceleration
class planewave_single(ptype):
"""
Example implementing a single particle spiraling in a trap
"""
def __init__(self, cparams, dtype_u=particles, dtype... | 31.892857 | 113 | 0.550504 |
import numpy as np
from pySDC.core.Problem import ptype
from pySDC.implementations.datatype_classes.particles import particles, fields, acceleration
class planewave_single(ptype):
def __init__(self, cparams, dtype_u=particles, dtype_f=fields):
assert 'delta' in cparams assert 'a0' in ... | true | true |
f76d9b0662aa9b46d51b51c9ff5915b9256fc282 | 10,008 | py | Python | salt/proxy/vcenter.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | 1 | 2020-04-09T03:25:10.000Z | 2020-04-09T03:25:10.000Z | salt/proxy/vcenter.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | salt/proxy/vcenter.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Proxy Minion interface module for managing VMWare vCenters.
:codeauthor: :email:`Rod McKenzie (roderick.mckenzie@morganstanley.com)`
:codeauthor: :email:`Alexandru Bleotu (alexandru.bleotu@morganstanley.com)`
Dependencies
============
- pyVmomi Python Module
pyVmomi
-------
PyVmomi can ... | 28.676218 | 82 | 0.681855 |
from __future__ import absolute_import, print_function, unicode_literals
import logging
import os
import salt.exceptions
from salt.config.schemas.vcenter import VCenterProxySchema
from salt.utils.dictupdate import merge
__proxyenabled__ = ["vcenter"]
# External libraries
try:
import jsonschema
HAS_JSONSCH... | true | true |
f76d9bc82e9a429e763f711536131dcad3f5a786 | 2,532 | py | Python | Code/ml_pipeline/model/ValidateConfig.py | anku18069/Machine-Olf-Action | f58636a703e2a29fdd39436c47400ebbc21542d8 | [
"MIT"
] | 1 | 2021-01-16T11:58:44.000Z | 2021-01-16T11:58:44.000Z | Code/ml_pipeline/model/ValidateConfig.py | anku18069/Machine-Olf-Action | f58636a703e2a29fdd39436c47400ebbc21542d8 | [
"MIT"
] | 1 | 2020-12-20T13:41:55.000Z | 2020-12-20T13:41:55.000Z | Code/ml_pipeline/model/ValidateConfig.py | anku18069/Machine-Olf-Action | f58636a703e2a29fdd39436c47400ebbc21542d8 | [
"MIT"
] | 2 | 2020-10-02T19:58:58.000Z | 2021-05-07T00:15:47.000Z | import ml_pipeline.utils.Logging as logging
logger = logging.logger
ALLOWED_USER_FILE_EXT = set(['csv'])
def validate_error_form_fields(config_form_dict):
logger.debug("Inside validate_error_form_fields - user submitted dict {}".format(config_form_dict))
config_user_dict = convert_user_dict_format(config_fo... | 37.235294 | 118 | 0.703397 | import ml_pipeline.utils.Logging as logging
logger = logging.logger
ALLOWED_USER_FILE_EXT = set(['csv'])
def validate_error_form_fields(config_form_dict):
logger.debug("Inside validate_error_form_fields - user submitted dict {}".format(config_form_dict))
config_user_dict = convert_user_dict_format(config_fo... | true | true |
f76d9c3093292711c4b13fe266f20e7059bf9136 | 9,417 | py | Python | utils/pointnet2_modules.py | sausagecy/Relation-Shape-CNN | a91ac768cd720773359dda9b3e234815f88d88b4 | [
"MIT"
] | null | null | null | utils/pointnet2_modules.py | sausagecy/Relation-Shape-CNN | a91ac768cd720773359dda9b3e234815f88d88b4 | [
"MIT"
] | null | null | null | utils/pointnet2_modules.py | sausagecy/Relation-Shape-CNN | a91ac768cd720773359dda9b3e234815f88d88b4 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import utils.pointnet2_utils as pointnet2_utils
import utils.pytorch_utils as pt_utils
from typing import List
import numpy as np
import time
import math
class _PointnetSAModuleBase(nn.Module):
def __init__(self):
super().__init__()
... | 34.243636 | 176 | 0.561113 | import torch
import torch.nn as nn
import torch.nn.functional as F
import utils.pointnet2_utils as pointnet2_utils
import utils.pytorch_utils as pt_utils
from typing import List
import numpy as np
import time
import math
class _PointnetSAModuleBase(nn.Module):
def __init__(self):
super().__init__()
... | true | true |
f76d9cb768bc50052c4439a3daf2b7fd1187095b | 19,547 | py | Python | google/cloud/dataflow_v1beta3/services/jobs_v1_beta3/transports/grpc_asyncio.py | LaudateCorpus1/python-dataflow-client | 888664b70baefe7acb7e46c82a06c24e7ba06af2 | [
"Apache-2.0"
] | 7 | 2021-11-04T03:22:01.000Z | 2022-02-05T14:28:50.000Z | google/cloud/dataflow_v1beta3/services/jobs_v1_beta3/transports/grpc_asyncio.py | LaudateCorpus1/python-dataflow-client | 888664b70baefe7acb7e46c82a06c24e7ba06af2 | [
"Apache-2.0"
] | 31 | 2021-06-26T01:14:50.000Z | 2022-03-17T03:01:49.000Z | google/cloud/dataflow_v1beta3/services/jobs_v1_beta3/transports/grpc_asyncio.py | LaudateCorpus1/python-dataflow-client | 888664b70baefe7acb7e46c82a06c24e7ba06af2 | [
"Apache-2.0"
] | 4 | 2021-08-31T11:41:16.000Z | 2022-01-29T08:09:21.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 44.024775 | 87 | 0.633089 | import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import gapic_v1
from google.api_core import grpc_helpers_async
from google.auth import credentials as ga_credentials from google.auth.transport.grpc import SslCredentials
import grpc from grpc.experi... | true | true |
f76d9cd36678be609f7373df612d091604edfb5c | 2,065 | py | Python | bootcamp/multimedia/migrations/0002_auto_20180206_1238.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/multimedia/migrations/0002_auto_20180206_1238.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/multimedia/migrations/0002_auto_20180206_1238.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-06 12:38
from __future__ import unicode_literals
import autoslug.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migr... | 40.490196 | 166 | 0.591283 | from __future__ import unicode_literals
import autoslug.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('multimedi... | true | true |
f76d9d75fbc8079c897f63ddd037ee342cc2b469 | 5,845 | py | Python | tests/backends/base/library.py | swinton/mopidy | c32c73f5112c29ef7ccccf36a508c571adb39759 | [
"Apache-2.0"
] | null | null | null | tests/backends/base/library.py | swinton/mopidy | c32c73f5112c29ef7ccccf36a508c571adb39759 | [
"Apache-2.0"
] | null | null | null | tests/backends/base/library.py | swinton/mopidy | c32c73f5112c29ef7ccccf36a508c571adb39759 | [
"Apache-2.0"
] | null | null | null | from mopidy.models import Playlist, Track, Album, Artist
from tests import unittest, path_to_data_dir
class LibraryControllerTest(object):
artists = [Artist(name='artist1'), Artist(name='artist2'), Artist()]
albums = [Album(name='album1', artists=artists[:1]),
Album(name='album2', artists=artists[1:2... | 36.993671 | 72 | 0.654063 | from mopidy.models import Playlist, Track, Album, Artist
from tests import unittest, path_to_data_dir
class LibraryControllerTest(object):
artists = [Artist(name='artist1'), Artist(name='artist2'), Artist()]
albums = [Album(name='album1', artists=artists[:1]),
Album(name='album2', artists=artists[1:2... | true | true |
f76d9d8b713a7452ab32bfa427e8d75392f6382e | 17,546 | py | Python | lib/detection_nms_v1.py | chuanglaipv/realtime_object_detection_xavier | 694c91db953a2e18440fcdcf5f38df90ba063bfc | [
"MIT"
] | 102 | 2018-04-11T09:32:16.000Z | 2021-11-04T16:52:09.000Z | lib/detection_nms_v1.py | chuanglaipv/realtime_object_detection_xavier | 694c91db953a2e18440fcdcf5f38df90ba063bfc | [
"MIT"
] | 24 | 2018-08-08T11:42:27.000Z | 2021-01-15T16:09:34.000Z | lib/detection_nms_v1.py | chuanglaipv/realtime_object_detection_xavier | 694c91db953a2e18440fcdcf5f38df90ba063bfc | [
"MIT"
] | 39 | 2018-05-23T08:34:00.000Z | 2020-04-07T12:01:57.000Z | import numpy as np
from tf_utils import visualization_utils_cv2 as vis_util
from lib.session_worker import SessionWorker
from lib.load_graph_nms_v1 import LoadFrozenGraph
from lib.load_label_map import LoadLabelMap
from lib.mpvariable import MPVariable
from lib.mpvisualizeworker import MPVisualizeWorker, visualization
... | 42.279518 | 182 | 0.474068 | import numpy as np
from tf_utils import visualization_utils_cv2 as vis_util
from lib.session_worker import SessionWorker
from lib.load_graph_nms_v1 import LoadFrozenGraph
from lib.load_label_map import LoadLabelMap
from lib.mpvariable import MPVariable
from lib.mpvisualizeworker import MPVisualizeWorker, visualization
... | true | true |
f76d9e81ed566665b3ed049403f59ef060137997 | 2,680 | py | Python | fhirclient/models/period.py | mdx-dev/client-py | f6c16c9bd386c5b05d69753b89c6519d568814ac | [
"Apache-2.0"
] | null | null | null | fhirclient/models/period.py | mdx-dev/client-py | f6c16c9bd386c5b05d69753b89c6519d568814ac | [
"Apache-2.0"
] | null | null | null | fhirclient/models/period.py | mdx-dev/client-py | f6c16c9bd386c5b05d69753b89c6519d568814ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Period) on 2019-01-22.
# 2019, SMART Health IT.
from . import element
class Period(element.Element):
"""
T
i
m
e
r
a
n
g
e
d
e
f
i... | 12.181818 | 103 | 0.361567 |
from . import element
class Period(element.Element):
resource_type = "Period"
def __init__(self, jsondict=None, strict=True):
self.end = None
self.start = None
super(Period, self).__init__(jsondict=jsondict, strict=strict)
def elementPrope... | true | true |
f76d9f875bd67f981356731efadf1006d84fa0e4 | 3,491 | py | Python | apps/network/src/main/core/services/transfer_service.py | aisportsbets/pygrid | eeee1e7ef6ba50a03f6f486992a45f7171976e5a | [
"Apache-2.0"
] | null | null | null | apps/network/src/main/core/services/transfer_service.py | aisportsbets/pygrid | eeee1e7ef6ba50a03f6f486992a45f7171976e5a | [
"Apache-2.0"
] | null | null | null | apps/network/src/main/core/services/transfer_service.py | aisportsbets/pygrid | eeee1e7ef6ba50a03f6f486992a45f7171976e5a | [
"Apache-2.0"
] | null | null | null | # stdlib
import secrets
from typing import List
from typing import Type
from typing import Union
import torch as th
# third party
from nacl.signing import VerifyKey
from nacl.encoding import HexEncoder
from syft.grid.client.client import connect
from syft.grid.client.grid_connection import GridHTTPConnection
from syft... | 30.094828 | 87 | 0.698654 | import secrets
from typing import List
from typing import Type
from typing import Union
import torch as th
from nacl.signing import VerifyKey
from nacl.encoding import HexEncoder
from syft.grid.client.client import connect
from syft.grid.client.grid_connection import GridHTTPConnection
from syft.core.node.domain.clien... | true | true |
f76da054ce036336500158971d7e832e84e73d50 | 704 | py | Python | lonely-lemmings/earlyinternet/gifapp/migrations/0002_auto_20200805_1307.py | skagawa2/summer-code-jam-2020 | 9f48a3027e76280247a8c56244e3595b6d5429b9 | [
"MIT"
] | null | null | null | lonely-lemmings/earlyinternet/gifapp/migrations/0002_auto_20200805_1307.py | skagawa2/summer-code-jam-2020 | 9f48a3027e76280247a8c56244e3595b6d5429b9 | [
"MIT"
] | null | null | null | lonely-lemmings/earlyinternet/gifapp/migrations/0002_auto_20200805_1307.py | skagawa2/summer-code-jam-2020 | 9f48a3027e76280247a8c56244e3595b6d5429b9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.9 on 2020-08-05 19:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('gifapp', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='project',
... | 28.16 | 120 | 0.612216 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('gifapp', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='project',
name='project_type',
field=models... | true | true |
f76da2fa03a3cb5c83e815679b04911f28b2dd1d | 446 | py | Python | src/workflow/configuration/secrets_reader.py | piotr-kalanski/service-initializer | 1662f9cfce1d7185129063f61d9e4fbd10ec8567 | [
"Apache-2.0"
] | 1 | 2020-04-17T10:46:48.000Z | 2020-04-17T10:46:48.000Z | src/workflow/configuration/secrets_reader.py | piotr-kalanski/service-initializer | 1662f9cfce1d7185129063f61d9e4fbd10ec8567 | [
"Apache-2.0"
] | 19 | 2020-03-17T18:40:58.000Z | 2020-03-24T18:35:36.000Z | src/workflow/configuration/secrets_reader.py | piotr-kalanski/service-initializer | 1662f9cfce1d7185129063f61d9e4fbd10ec8567 | [
"Apache-2.0"
] | null | null | null | import os
from typing import List
import yaml
class SecretsReader:
def read(self, environment_variables: dict, files: List[str]) -> dict:
result = {}
for file in files:
result.update(yaml.load(open(file), Loader=yaml.FullLoader))
for (environment_variable_name,secret_key) in... | 24.777778 | 84 | 0.681614 | import os
from typing import List
import yaml
class SecretsReader:
def read(self, environment_variables: dict, files: List[str]) -> dict:
result = {}
for file in files:
result.update(yaml.load(open(file), Loader=yaml.FullLoader))
for (environment_variable_name,secret_key) in... | true | true |
f76da40522082053d564bcc434e5caf215880b20 | 4,011 | py | Python | app-e-commerce-django/cart/tests/test_cart.py | WellingtonFidelis/python-projects | 0f2ca2c1198f41ff3ef551f3f9c7c6454c748ce9 | [
"MIT"
] | null | null | null | app-e-commerce-django/cart/tests/test_cart.py | WellingtonFidelis/python-projects | 0f2ca2c1198f41ff3ef551f3f9c7c6454c748ce9 | [
"MIT"
] | null | null | null | app-e-commerce-django/cart/tests/test_cart.py | WellingtonFidelis/python-projects | 0f2ca2c1198f41ff3ef551f3f9c7c6454c748ce9 | [
"MIT"
] | null | null | null | import pytest
from django.conf import settings
from django.contrib.sessions.middleware import SessionMiddleware
from django.http import HttpRequest
from products.tests.factories import ProductFactory
from ..cart import Cart
pytestmark = pytest.mark.django_db
def dummy_get_response(request):
return None
@pytes... | 24.607362 | 77 | 0.704313 | import pytest
from django.conf import settings
from django.contrib.sessions.middleware import SessionMiddleware
from django.http import HttpRequest
from products.tests.factories import ProductFactory
from ..cart import Cart
pytestmark = pytest.mark.django_db
def dummy_get_response(request):
return None
@pytes... | true | true |
f76da4cff93628b97a04957147db12112a963f5c | 1,709 | py | Python | app/core/migrations/0001_initial.py | mojjoGh/recipe-app-api | 340bbe0e1c38f99aed1f7fb95bfc73792aa67793 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | mojjoGh/recipe-app-api | 340bbe0e1c38f99aed1f7fb95bfc73792aa67793 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | mojjoGh/recipe-app-api | 340bbe0e1c38f99aed1f7fb95bfc73792aa67793 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.11 on 2019-08-18 07:02
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.264706 | 266 | 0.63897 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.Aut... | true | true |
f76da50d713f3a969cafe7b230698607221ab30b | 1,013 | py | Python | bem/fast_interpolation.py | ricklupton/py-bem | 026b2b82b6f09d57b213cfe17aa849dbdf3c7b71 | [
"MIT"
] | 25 | 2015-01-21T19:41:00.000Z | 2022-02-03T06:57:59.000Z | bem/fast_interpolation.py | enritoomey/py-bem | 026b2b82b6f09d57b213cfe17aa849dbdf3c7b71 | [
"MIT"
] | 1 | 2019-08-29T06:41:49.000Z | 2019-09-26T02:33:14.000Z | bem/fast_interpolation.py | enritoomey/py-bem | 026b2b82b6f09d57b213cfe17aa849dbdf3c7b71 | [
"MIT"
] | 13 | 2015-05-20T17:20:22.000Z | 2021-06-26T02:49:30.000Z | """
From http://stackoverflow.com/a/13504757
"""
from scipy.interpolate import interp1d
from scipy.interpolate._fitpack import _bspleval
import numpy as np
class fast_interpolation:
def __init__(self, x, y, axis=-1):
assert len(x) == y.shape[axis]
self.x = x
self.y = y
self.axis =... | 28.942857 | 72 | 0.587364 |
from scipy.interpolate import interp1d
from scipy.interpolate._fitpack import _bspleval
import numpy as np
class fast_interpolation:
def __init__(self, x, y, axis=-1):
assert len(x) == y.shape[axis]
self.x = x
self.y = y
self.axis = axis
self._f = interp1d(x, y, axis=axis,... | true | true |
f76da6c63c71978e9077e196f8b2297b118ec2b6 | 671 | py | Python | kaggle/sf-crime/logistic_regressions.py | noelevans/playground | da529e967a15bcb217fff091ac0ec5c4dc1821ce | [
"MIT"
] | 1 | 2015-04-28T20:36:57.000Z | 2015-04-28T20:36:57.000Z | kaggle/sf-crime/logistic_regressions.py | noelevans/playground | da529e967a15bcb217fff091ac0ec5c4dc1821ce | [
"MIT"
] | 2 | 2021-02-03T21:05:54.000Z | 2021-03-23T09:25:43.000Z | kaggle/sf-crime/logistic_regressions.py | noelevans/playground | da529e967a15bcb217fff091ac0ec5c4dc1821ce | [
"MIT"
] | null | null | null | from sklearn.linear_model import LogisticRegression
class MultivariateLogisticOvrModel(object):
def model_and_predict(self, X_train, y_train, X_test):
model = LogisticRegression(dual=True, fit_intercept=True,
multi_class='ovr')
model.fit(X_train, y_train)
... | 31.952381 | 68 | 0.66617 | from sklearn.linear_model import LogisticRegression
class MultivariateLogisticOvrModel(object):
def model_and_predict(self, X_train, y_train, X_test):
model = LogisticRegression(dual=True, fit_intercept=True,
multi_class='ovr')
model.fit(X_train, y_train)
... | true | true |
f76da7393486e7ec82786309581784180335c97a | 28,559 | py | Python | descriptors/txtgrey.py | higex/qpath | 0377f2fdadad6e02ecde8ba2557fe9b957280fa1 | [
"MIT"
] | 6 | 2017-03-18T19:17:42.000Z | 2019-05-05T14:57:31.000Z | WSItk/descriptors/txtgrey.py | vladpopovici/WSItk | 02db9dbf1148106a576d7b4dd7965c73607efdae | [
"MIT"
] | null | null | null | WSItk/descriptors/txtgrey.py | vladpopovici/WSItk | 02db9dbf1148106a576d7b4dd7965c73607efdae | [
"MIT"
] | 4 | 2015-11-29T14:47:25.000Z | 2019-11-28T03:16:39.000Z | """
DESCRIPTORS.TXTGREY: textural descriptors from grey-scale images.
@author: vlad
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
__version__ = 0.05
__author__ = 'Vlad Popovici'
__all__ = ['GaborDescriptor', 'LBPDescriptor', 'GLCMDescriptor', 'HOGDescriptor',
'His... | 33.519953 | 115 | 0.538394 | """
DESCRIPTORS.TXTGREY: textural descriptors from grey-scale images.
@author: vlad
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
__version__ = 0.05
__author__ = 'Vlad Popovici'
__all__ = ['GaborDescriptor', 'LBPDescriptor', 'GLCMDescriptor', 'HOGDescriptor',
'His... | false | true |
f76da7aaedbb6fd249349293960594b54abdb48a | 890 | py | Python | python/helpers/pydev/tests_pydevd_python/_debugger_case_qthread4.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 349 | 2019-05-07T00:15:12.000Z | 2022-03-10T15:05:08.000Z | python/helpers/pydev/tests_pydevd_python/_debugger_case_qthread4.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 1,095 | 2018-03-01T00:50:11.000Z | 2019-05-06T17:44:15.000Z | python/helpers/pydev/tests_pydevd_python/_debugger_case_qthread4.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 53 | 2018-03-01T00:33:57.000Z | 2019-05-05T00:50:23.000Z | try:
from PySide import QtCore
except:
try:
from PyQt4 import QtCore
except:
from PyQt5 import QtCore
class TestObject(QtCore.QObject):
"""
Test class providing some non-argument signal
"""
try:
testSignal = QtCore.Signal() # @UndefinedVariable
except:
... | 21.190476 | 62 | 0.694382 | try:
from PySide import QtCore
except:
try:
from PyQt4 import QtCore
except:
from PyQt5 import QtCore
class TestObject(QtCore.QObject):
try:
testSignal = QtCore.Signal() except:
testSignal = QtCore.pyqtSignal()
class TestThread(QtCore.QThread):
def run(self... | true | true |
f76da7fda73c998aeebaec5e2459c370b886fe77 | 3,539 | py | Python | apps/djangit/management/commands/gitosis_import.py | dokkaebi/djangit | 57defd485846998685b29ff6b0dfe3393a16999c | [
"Apache-2.0"
] | 1 | 2021-04-01T07:57:16.000Z | 2021-04-01T07:57:16.000Z | apps/djangit/management/commands/gitosis_import.py | dokkaebi/djangit | 57defd485846998685b29ff6b0dfe3393a16999c | [
"Apache-2.0"
] | 3 | 2020-02-11T22:07:29.000Z | 2021-06-10T17:39:16.000Z | apps/djangit/management/commands/gitosis_import.py | dokkaebi/djangit | 57defd485846998685b29ff6b0dfe3393a16999c | [
"Apache-2.0"
] | null | null | null | import ConfigParser
import os
import sys
import re
from django.core.management.base import LabelCommand, CommandError
from django.contrib.auth.models import User
from djangit.models import *
class Command(LabelCommand):
def handle_label(self, label, **options):
cfg = ConfigParser.ConfigParser()
... | 33.386792 | 98 | 0.43939 | import ConfigParser
import os
import sys
import re
from django.core.management.base import LabelCommand, CommandError
from django.contrib.auth.models import User
from djangit.models import *
class Command(LabelCommand):
def handle_label(self, label, **options):
cfg = ConfigParser.ConfigParser()
... | true | true |
f76da89de447086f13d7520e6ea4ddfac298929b | 27,168 | py | Python | google/cloud/dialogflow/v2beta1/dialogflow-v2beta1-py/google/cloud/dialogflow_v2beta1/services/conversation_profiles/async_client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/dialogflow/v2beta1/dialogflow-v2beta1-py/google/cloud/dialogflow_v2beta1/services/conversation_profiles/async_client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/dialogflow/v2beta1/dialogflow-v2beta1-py/google/cloud/dialogflow_v2beta1/services/conversation_profiles/async_client.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 45.355593 | 152 | 0.660483 | from collections import OrderedDict
import functools
import re
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources
import google.api_core.client_options as ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.... | true | true |
f76da8cf5400cbdee6d5577c738c25bec19fa7d6 | 45 | py | Python | tests/__init__.py | saeedesmaili/twitter-blocker | 0a58bcd0a483c54ef1a274804bb80fa132839834 | [
"MIT"
] | null | null | null | tests/__init__.py | saeedesmaili/twitter-blocker | 0a58bcd0a483c54ef1a274804bb80fa132839834 | [
"MIT"
] | null | null | null | tests/__init__.py | saeedesmaili/twitter-blocker | 0a58bcd0a483c54ef1a274804bb80fa132839834 | [
"MIT"
] | null | null | null | """Unit test package for twitter_blocker."""
| 22.5 | 44 | 0.733333 | true | true | |
f76daa7af02903a5acec12115730e941c8e49b88 | 6,995 | py | Python | imagepy/menus/Plugins/Surf/surf_plg.py | siyemuxu888/imagepy | a933526483a15da282bacac54608d44d2173beb4 | [
"BSD-4-Clause"
] | null | null | null | imagepy/menus/Plugins/Surf/surf_plg.py | siyemuxu888/imagepy | a933526483a15da282bacac54608d44d2173beb4 | [
"BSD-4-Clause"
] | null | null | null | imagepy/menus/Plugins/Surf/surf_plg.py | siyemuxu888/imagepy | a933526483a15da282bacac54608d44d2173beb4 | [
"BSD-4-Clause"
] | null | null | null | import cv2, wx
from imagepy.core.engine import Filter, Simple, Tool
from imagepy.core.manager import WindowsManager
from .matcher import Matcher
import numpy as np
from imagepy import IPy
CVSURF = cv2.xfeatures2d.SURF_create if cv2.__version__[0] =="3" else cv2.SURF
class FeatMark:
def __init__(self, feats):
... | 39.519774 | 87 | 0.533524 | import cv2, wx
from imagepy.core.engine import Filter, Simple, Tool
from imagepy.core.manager import WindowsManager
from .matcher import Matcher
import numpy as np
from imagepy import IPy
CVSURF = cv2.xfeatures2d.SURF_create if cv2.__version__[0] =="3" else cv2.SURF
class FeatMark:
def __init__(self, feats):
... | true | true |
f76daab5d8289cd8013dda529f1934f346fcf30a | 335 | py | Python | bench/bench_dense_to_sparse.py | olgabot/pandas | 286811a2775c9b5ca1c30086b1950dd1060ecf68 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 2 | 2017-03-10T04:16:05.000Z | 2019-04-19T23:02:48.000Z | bench/bench_dense_to_sparse.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | bench/bench_dense_to_sparse.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2019-07-30T02:42:51.000Z | 2019-07-30T02:42:51.000Z | from pandas import *
K = 100
N = 100000
rng = DateRange('1/1/2000', periods=N, offset=datetools.Minute())
rng2 = np.asarray(rng).astype('M8[us]').astype('i8')
series = {}
for i in range(1, K + 1):
data = np.random.randn(N)[:-i]
this_rng = rng2[:-i]
data[100:] = np.nan
series[i] = SparseSeries(data, i... | 22.333333 | 65 | 0.620896 | from pandas import *
K = 100
N = 100000
rng = DateRange('1/1/2000', periods=N, offset=datetools.Minute())
rng2 = np.asarray(rng).astype('M8[us]').astype('i8')
series = {}
for i in range(1, K + 1):
data = np.random.randn(N)[:-i]
this_rng = rng2[:-i]
data[100:] = np.nan
series[i] = SparseSeries(data, i... | true | true |
f76dae8c9afb1e179a1dbf101f377a177aa2a7ac | 2,176 | py | Python | examples/server.py | AutomatedTester/trio-websocket | 2ab9e14178e34259be3de32854afa9fd985e5e0e | [
"MIT"
] | null | null | null | examples/server.py | AutomatedTester/trio-websocket | 2ab9e14178e34259be3de32854afa9fd985e5e0e | [
"MIT"
] | null | null | null | examples/server.py | AutomatedTester/trio-websocket | 2ab9e14178e34259be3de32854afa9fd985e5e0e | [
"MIT"
] | null | null | null | '''
This simple WebSocket server responds to text messages by reversing each
message string and sending it back.
It also handles ping/pong automatically and will correctly close down a
connection when the client requests it.
To use SSL/TLS: install the `trustme` package from PyPI and run the
`generate-cert.py` script... | 30.647887 | 81 | 0.681985 | import argparse
import logging
import pathlib
import ssl
import sys
import trio
from trio_websocket import serve_websocket, ConnectionClosed
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger()
here = pathlib.Path(__file__).parent
def parse_args():
parser = argparse.ArgumentParser(description=... | true | true |
f76daf0c511cb41eb93657c0d60e272fb3cf0dca | 7,641 | py | Python | osplugin/service/security_group_service.py | EdgeGallery/mecm-applcm | fceecd1f260ce3b72faa252882b7a93aa22c6334 | [
"Apache-2.0"
] | 20 | 2021-02-27T10:02:21.000Z | 2021-03-12T10:15:20.000Z | osplugin/service/security_group_service.py | EdgeGallery/mecm-applcm | fceecd1f260ce3b72faa252882b7a93aa22c6334 | [
"Apache-2.0"
] | null | null | null | osplugin/service/security_group_service.py | EdgeGallery/mecm-applcm | fceecd1f260ce3b72faa252882b7a93aa22c6334 | [
"Apache-2.0"
] | 2 | 2021-04-01T08:57:51.000Z | 2021-04-22T04:26:27.000Z | """
# Copyright 2021 21CN Corporation Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 37.273171 | 118 | 0.633556 |
import json
from neutronclient.common.exceptions import NotFound
import utils
from core.log import logger
from core.openstack_utils import create_neutron_client
from internal.resourcemanager import resourcemanager_pb2_grpc
from internal.resourcemanager.resourcemanager_pb2 import CreateSecurityGroupResponse, DeleteSe... | true | true |
f76daf729df49b4f86d7349aaca1e853237bba42 | 5,878 | py | Python | business_rules/engine.py | rsest/business-rules | f9080651bbb1cd13f3a88b72db40c1b2ae06d388 | [
"MIT"
] | 1 | 2020-11-19T15:08:52.000Z | 2020-11-19T15:08:52.000Z | business_rules/engine.py | rsest/business-rules | f9080651bbb1cd13f3a88b72db40c1b2ae06d388 | [
"MIT"
] | null | null | null | business_rules/engine.py | rsest/business-rules | f9080651bbb1cd13f3a88b72db40c1b2ae06d388 | [
"MIT"
] | 2 | 2020-11-19T21:25:12.000Z | 2020-11-20T19:44:50.000Z | from .fields import FIELD_NO_INPUT
class InvalidRuleDefinition(Exception):
pass
def get_value(rule_list, defined_variables, defined_actions):
""" Run Rules till first will be triggered and returns its actions results.
Exception will be raised if more than one action was executed by the triggered rule.
... | 36.06135 | 101 | 0.671317 | from .fields import FIELD_NO_INPUT
class InvalidRuleDefinition(Exception):
pass
def get_value(rule_list, defined_variables, defined_actions):
rule_results = run_all(rule_list, defined_variables, defined_actions, stop_on_first_trigger=True)
if len(rule_results) == 0:
raise InvalidRuleDefinition(
... | true | true |
f76daf9d11303367a8dde8a5640d718a200a3056 | 1,134 | py | Python | batchflow/models/metrics/loss.py | bestetc/batchflow | d2a843640383fbe860654236881483f755227e06 | [
"Apache-2.0"
] | 101 | 2017-06-05T07:33:54.000Z | 2018-10-28T04:55:23.000Z | batchflow/models/metrics/loss.py | bestetc/batchflow | d2a843640383fbe860654236881483f755227e06 | [
"Apache-2.0"
] | 243 | 2018-11-29T02:03:55.000Z | 2022-02-21T08:28:29.000Z | batchflow/models/metrics/loss.py | bestetc/batchflow | d2a843640383fbe860654236881483f755227e06 | [
"Apache-2.0"
] | 35 | 2019-01-29T14:26:14.000Z | 2021-12-30T01:39:02.000Z | """ Loss as a Metrics to be used in research pipelines added with `run=True` """
import numpy as np
from .base import Metrics
class Loss(Metrics):
"""
This is a helper class to aggregate losses from pipelines
that are used in Research objects with `run=True`,
like test pipelines
Parameters
... | 25.2 | 81 | 0.626102 |
import numpy as np
from .base import Metrics
class Loss(Metrics):
def __init__(self, loss, batch_len):
super().__init__()
self.losses = [loss]
self.batch_lengths = [batch_len]
def agg_loss(args):
losses, blens = args
return np.sum(np.asarray(losses) * n... | true | true |
f76dafa30ca53fdda28a9bf7d88ef13901913ba5 | 301 | py | Python | ptsemseg/loader/__init__.py | shahsohil/sunets | 11057da8adb886c62712a8e0f75f7e9bf10485cf | [
"MIT"
] | 161 | 2018-04-30T02:12:13.000Z | 2022-03-28T12:20:55.000Z | ptsemseg/loader/__init__.py | shahsohil/sunets | 11057da8adb886c62712a8e0f75f7e9bf10485cf | [
"MIT"
] | 9 | 2018-05-03T16:01:40.000Z | 2021-02-09T18:56:27.000Z | ptsemseg/loader/__init__.py | shahsohil/sunets | 11057da8adb886c62712a8e0f75f7e9bf10485cf | [
"MIT"
] | 38 | 2018-05-02T13:57:12.000Z | 2022-03-28T12:21:07.000Z | from ptsemseg.loader.pascal_voc_loader import pascalVOCLoader
from ptsemseg.loader.coco_loader import COCOLoader
def get_loader(name):
"""get_loader
:param name:
"""
return {
'pascal': pascalVOCLoader,
'sbd': pascalVOCLoader,
'coco': COCOLoader,
}[name]
| 20.066667 | 61 | 0.664452 | from ptsemseg.loader.pascal_voc_loader import pascalVOCLoader
from ptsemseg.loader.coco_loader import COCOLoader
def get_loader(name):
return {
'pascal': pascalVOCLoader,
'sbd': pascalVOCLoader,
'coco': COCOLoader,
}[name]
| true | true |
f76db0d227a28559fcaf0408d3a54aff21e14486 | 80 | py | Python | python/testData/intentions/PyInvertIfConditionIntentionTest/conditionEq.py | Starmel/intellij-community | adb89951109732e585d04f33e3fabbc9f9d3b256 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/intentions/PyInvertIfConditionIntentionTest/conditionEq.py | Starmel/intellij-community | adb89951109732e585d04f33e3fabbc9f9d3b256 | [
"Apache-2.0"
] | null | null | null | python/testData/intentions/PyInvertIfConditionIntentionTest/conditionEq.py | Starmel/intellij-community | adb89951109732e585d04f33e3fabbc9f9d3b256 | [
"Apache-2.0"
] | null | null | null | value = 1
<caret>if value == 1:
print("Equal")
else:
print("Not equal") | 13.333333 | 22 | 0.575 | value = 1
<caret>if value == 1:
print("Equal")
else:
print("Not equal") | false | true |
f76db0f2d743a6cebfa955454e49a89cd69ed95a | 3,517 | py | Python | hlwtadmin/management/commands/refresh_songkick_cas.py | Kunstenpunt/havelovewilltravel | 6a27824b4d3d8b1bf19e0bc0d0648f0f4e8abc83 | [
"Apache-2.0"
] | 1 | 2020-10-16T16:29:01.000Z | 2020-10-16T16:29:01.000Z | hlwtadmin/management/commands/refresh_songkick_cas.py | Kunstenpunt/havelovewilltravel | 6a27824b4d3d8b1bf19e0bc0d0648f0f4e8abc83 | [
"Apache-2.0"
] | 365 | 2020-02-03T12:46:53.000Z | 2022-02-27T17:20:46.000Z | hlwtadmin/management/commands/refresh_songkick_cas.py | Kunstenpunt/havelovewilltravel | 6a27824b4d3d8b1bf19e0bc0d0648f0f4e8abc83 | [
"Apache-2.0"
] | null | null | null | from hlwtadmin.models import Artist, GigFinderUrl, GigFinder, ConcertAnnouncement, Venue, Location, Organisation, Country, Concert, RelationConcertConcert, RelationConcertOrganisation, RelationConcertArtist, Location
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
... | 50.971014 | 216 | 0.575775 | from hlwtadmin.models import Artist, GigFinderUrl, GigFinder, ConcertAnnouncement, Venue, Location, Organisation, Country, Concert, RelationConcertConcert, RelationConcertOrganisation, RelationConcertArtist, Location
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
... | true | true |
f76db14f150407c4cab00ccd57a2a9b3e22e0778 | 2,303 | py | Python | yape/tests/test_parsepbuttons.py | casep/yape | 5274b8f2fd47f7f458dcd9edaaf20d4329ad4783 | [
"MIT"
] | 12 | 2017-02-10T13:13:31.000Z | 2019-05-10T21:41:55.000Z | yape/tests/test_parsepbuttons.py | casep/yape | 5274b8f2fd47f7f458dcd9edaaf20d4329ad4783 | [
"MIT"
] | 18 | 2018-04-25T02:40:50.000Z | 2021-03-18T06:51:29.000Z | yape/tests/test_parsepbuttons.py | casep/yape | 5274b8f2fd47f7f458dcd9edaaf20d4329ad4783 | [
"MIT"
] | 10 | 2017-02-20T10:20:50.000Z | 2019-07-24T16:51:30.000Z | from yape.main import fileout, fileout_splitcols, parse_args, yape2
from yape.parsepbuttons import parsepbuttons
import os
import traceback
import logging
TEST_DIR = "testdata"
TEST_RESULTS = "testresults"
# just to understand how tests work
class TestParser:
def test_is_string(self):
s = "this is a test"... | 31.121622 | 96 | 0.532783 | from yape.main import fileout, fileout_splitcols, parse_args, yape2
from yape.parsepbuttons import parsepbuttons
import os
import traceback
import logging
TEST_DIR = "testdata"
TEST_RESULTS = "testresults"
class TestParser:
def test_is_string(self):
s = "this is a test"
assert isinstance(s, str)
... | true | true |
f76db14f5562bf3b6efb99a5ea246cbd33821ead | 45,436 | py | Python | cupyx/scipy/ndimage/_measurements.py | Onkar627/cupy | 8eef1ad5393c0a92c5065bc05137bf997f37044a | [
"MIT"
] | 1 | 2022-01-12T22:57:54.000Z | 2022-01-12T22:57:54.000Z | cupyx/scipy/ndimage/_measurements.py | Onkar627/cupy | 8eef1ad5393c0a92c5065bc05137bf997f37044a | [
"MIT"
] | null | null | null | cupyx/scipy/ndimage/_measurements.py | Onkar627/cupy | 8eef1ad5393c0a92c5065bc05137bf997f37044a | [
"MIT"
] | 1 | 2022-03-21T20:19:12.000Z | 2022-03-21T20:19:12.000Z | import warnings
import numpy
import cupy
from cupy import _core
from cupy import _util
def label(input, structure=None, output=None):
"""Labels features in an array.
Args:
input (cupy.ndarray): The input array.
structure (array_like or None): A structuring element that defines
f... | 36.641935 | 79 | 0.618188 | import warnings
import numpy
import cupy
from cupy import _core
from cupy import _util
def label(input, structure=None, output=None):
if not isinstance(input, cupy.ndarray):
raise TypeError('input must be cupy.ndarray')
if input.dtype.char in 'FD':
raise TypeError('Complex type not supported... | true | true |
f76db1d274c7ec14baf033f2f6158b4c818312ca | 899 | py | Python | Python/Sending_Motivational_Emails_On_Mondays/angela_version.py | douglasadones/ProjetosPython | 310068368f3fe9379939e27c6416611ba248c620 | [
"MIT"
] | null | null | null | Python/Sending_Motivational_Emails_On_Mondays/angela_version.py | douglasadones/ProjetosPython | 310068368f3fe9379939e27c6416611ba248c620 | [
"MIT"
] | null | null | null | Python/Sending_Motivational_Emails_On_Mondays/angela_version.py | douglasadones/ProjetosPython | 310068368f3fe9379939e27c6416611ba248c620 | [
"MIT"
] | null | null | null | import smtplib
import datetime as dt
from random import choice
def sundays_emails():
# Usando o arquivo .txt das citações
with open("quotes.txt", "r") as citacoes:
quote_list = citacoes.readlines()
# Informações necessárias para o envio do email
host = "host do seu e-mail"
port = int
... | 24.297297 | 93 | 0.660734 | import smtplib
import datetime as dt
from random import choice
def sundays_emails():
with open("quotes.txt", "r") as citacoes:
quote_list = citacoes.readlines()
host = "host do seu e-mail"
port = int
MY_EMAIL = "seu email"
MY_PASSWORD = "senha do seu email"
target_email = "ema... | true | true |
f76db251f0ceb323466a4f23b2df6501aafd4626 | 408 | py | Python | apps/core/urls.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 19 | 2017-09-13T07:51:58.000Z | 2022-03-28T11:04:03.000Z | apps/core/urls.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 147 | 2017-09-14T13:45:30.000Z | 2022-03-14T15:54:09.000Z | apps/core/urls.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 5 | 2019-08-31T13:13:30.000Z | 2021-03-26T15:46:38.000Z | from django.urls import path, include
from apps.core.views import HomeView, InvalidSsoLoginView, StatusView, router
urlpatterns = [
path('api/', include(router.urls)),
path('api/home/', view=HomeView.as_view(), name='HomeView'),
path('api/status/', view=StatusView.as_view(), name='StatusView'),
path(... | 34 | 94 | 0.723039 | from django.urls import path, include
from apps.core.views import HomeView, InvalidSsoLoginView, StatusView, router
urlpatterns = [
path('api/', include(router.urls)),
path('api/home/', view=HomeView.as_view(), name='HomeView'),
path('api/status/', view=StatusView.as_view(), name='StatusView'),
path(... | true | true |
f76db2b5c96df1ad5fa5e62903008b5c1b529873 | 122,509 | py | Python | scalyr_agent/log_processing.py | jmorascalyr/scalyr-agent-2 | f430f1df3e0ce4e3f7231d515fb99eea5fa295e2 | [
"Apache-2.0"
] | null | null | null | scalyr_agent/log_processing.py | jmorascalyr/scalyr-agent-2 | f430f1df3e0ce4e3f7231d515fb99eea5fa295e2 | [
"Apache-2.0"
] | null | null | null | scalyr_agent/log_processing.py | jmorascalyr/scalyr-agent-2 | f430f1df3e0ce4e3f7231d515fb99eea5fa295e2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Scalyr Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 47.668872 | 160 | 0.63619 | import sys
__author__ = 'czerwin@scalyr.com'
import datetime
import errno
import fnmatch
import glob
import os
import random
import re
import string
import threading
import time
import timeit
import scalyr_agent.json_lib as json_lib
import scalyr_agent.scalyr_logging as scalyr_logging
import scalyr_agent.util as sca... | false | true |
f76db30983247e9cdf26bd42925aaf84fb3fbff0 | 22,141 | py | Python | tensorflow_probability/python/mcmc/replica_exchange_mc.py | bolcom/probability | 4a11efad1ecd8a1336e4c9fdb0105efbf2375ad7 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/mcmc/replica_exchange_mc.py | bolcom/probability | 4a11efad1ecd8a1336e4c9fdb0105efbf2375ad7 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/mcmc/replica_exchange_mc.py | bolcom/probability | 4a11efad1ecd8a1336e4c9fdb0105efbf2375ad7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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... | 38.372617 | 80 | 0.681315 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import tensorflow.compat.v1 as tf1
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.mcmc import kernel as kernel_base
from tensorflow_probability.python.mcmc.internal i... | true | true |
f76db32d8ae95a54e4d65cf949710c3804166399 | 8,765 | py | Python | sms_bomb.py | TarushS/sms-bomber-india | 6506c5c6cc256a61788bdb51e705953a0e08ae39 | [
"MIT"
] | 4 | 2018-06-08T11:49:55.000Z | 2019-03-29T19:09:38.000Z | sms_bomb.py | TarushS/sms-bomber-india | 6506c5c6cc256a61788bdb51e705953a0e08ae39 | [
"MIT"
] | 2 | 2019-03-28T00:00:58.000Z | 2019-11-10T08:42:58.000Z | sms_bomb.py | ghoshben/sms-bomber-india | 08a71a0dcd26b7e32f5b95396810710ad41ca29f | [
"MIT"
] | 6 | 2018-06-17T10:34:04.000Z | 2020-11-12T09:14:37.000Z | import os
banner='''
____ _ _ _ _ ____ _ _ _ __ __
/ ___|| | | | | | | __ )| | | | / \ | \/ |
\___ \| |_| | | | | _ \| |_| | / _ \ | |\/| |
___) | _ | |_| | |_) | _ |/ ___ \| | | |
|____/|_| |_|\___/|____/|_| |_... | 125.214286 | 717 | 0.699258 | import os
banner='''
____ _ _ _ _ ____ _ _ _ __ __
/ ___|| | | | | | | __ )| | | | / \ | \/ |
\___ \| |_| | | | | _ \| |_| | / _ \ | |\/| |
___) | _ | |_| | |_) | _ |/ ___ \| | | |
|____/|_| |_|\___/|____/|_| |_... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.