hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b00fdf645e24fa341a96a6d75f969fd9667dde7e | 5,467 | py | Python | py2cytoscape/cyrest/base.py | g-simmons2/py2cytoscape | e2cd1c5d598e1da02f50273e958ddf574c523eb8 | [
"MIT"
] | 97 | 2018-01-23T00:20:51.000Z | 2022-03-11T05:01:01.000Z | py2cytoscape/cyrest/base.py | g-simmons2/py2cytoscape | e2cd1c5d598e1da02f50273e958ddf574c523eb8 | [
"MIT"
] | 64 | 2018-01-24T14:51:20.000Z | 2022-02-21T01:05:02.000Z | py2cytoscape/cyrest/base.py | g-simmons2/py2cytoscape | e2cd1c5d598e1da02f50273e958ddf574c523eb8 | [
"MIT"
] | 25 | 2018-01-20T20:29:39.000Z | 2021-04-09T17:28:58.000Z | import sys
import requests
from json import JSONDecodeError
HOST = 'localhost'
IP=HOST # temporary
PORT = 1234
VERSION = 'v1'
BASE_URL = 'http://' + HOST + ':' + str(PORT) + '/' + VERSION + '/'
HEADERS = {'Content-Type': 'application/json'}
VERBOSE=False
SUID_LIST = 'suid'
BASE_URL_NETWORK = BASE_URL + 'networks'... | 27.892857 | 163 | 0.546003 | import sys
import requests
import urllib.request as urllib2
import json
from json import JSONDecodeError
HOST = 'localhost'
IP=HOST # temporary
PORT = 1234
VERSION = 'v1'
BASE_URL = 'http://' + HOST + ':' + str(PORT) + '/' + VERSION + '/'
HEADERS = {'Content-Type': 'application/json'}
VERBOSE=False
SUID_LIST = '... | 0 | 0 | 0 | 0 | 0 | 1,186 | 0 | 1 | 168 |
e1a7b62d1b6436c85a68e5005a88db5375a0b92a | 17,621 | py | Python | mava/utils/environments/RoboCup_env/robocup_utils/player_world_model.py | 1998x-stack/Mava | 2c8f7f59f235340886e92045b6730cf5a542a496 | [
"Apache-2.0"
] | 1 | 2022-03-19T12:51:16.000Z | 2022-03-19T12:51:16.000Z | mava/utils/environments/RoboCup_env/robocup_utils/player_world_model.py | 1998x-stack/Mava | 2c8f7f59f235340886e92045b6730cf5a542a496 | [
"Apache-2.0"
] | null | null | null | mava/utils/environments/RoboCup_env/robocup_utils/player_world_model.py | 1998x-stack/Mava | 2c8f7f59f235340886e92045b6730cf5a542a496 | [
"Apache-2.0"
] | null | null | null | # python3
# Copyright 2021 InstaDeep Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 32.875 | 82 | 0.599682 | # python3
# Copyright 2021 InstaDeep Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 0 | 0 | 0 | 16,133 | 0 | 167 | 0 | 75 | 114 |
d6199345f3b02c33dea17eed354597e189a3c22c | 362 | py | Python | .history/SteeringTest_20190119133825.py | zhenglitao1/piCar | b8f77f28ea61159c55746b0a3474ebfc3c66b6ba | [
"Apache-2.0"
] | null | null | null | .history/SteeringTest_20190119133825.py | zhenglitao1/piCar | b8f77f28ea61159c55746b0a3474ebfc3c66b6ba | [
"Apache-2.0"
] | null | null | null | .history/SteeringTest_20190119133825.py | zhenglitao1/piCar | b8f77f28ea61159c55746b0a3474ebfc3c66b6ba | [
"Apache-2.0"
] | null | null | null | from SteeringModule.Steering import Steering
import time
steer=Steering(14,0,180,15,90,180,36,160)
steer.setup()
time.sleep(2)
for i in range(0,900):
steer.Up()
for i in range(0,900):
steer.Down()
for i in range(0,900):
steer.Left()
for i in range(0,900):
steer.Right()
steer.specify(80,120)
steer.specify(20,100... | 15.73913 | 44 | 0.718232 | from SteeringModule.Steering import Steering
import time
steer=Steering(14,0,180,15,90,180,36,160)
steer.setup()
time.sleep(2)
for i in range(0,900):
steer.Up()
for i in range(0,900):
steer.Down()
for i in range(0,900):
steer.Left()
for i in range(0,900):
steer.Right()
steer.specify(80,120)
steer.specify(20,100... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9c26595469c213773920f44763083b599458d6dc | 25,051 | py | Python | pycab/CabStructs.py | n3k/PyCAB | 665544ec1d81c76d233dfca2c7c75cd11605ae5c | [
"MIT"
] | 5 | 2015-09-24T20:50:51.000Z | 2016-12-09T06:05:27.000Z | pycab/CabStructs.py | n3k/PyCAB | 665544ec1d81c76d233dfca2c7c75cd11605ae5c | [
"MIT"
] | null | null | null | pycab/CabStructs.py | n3k/PyCAB | 665544ec1d81c76d233dfca2c7c75cd11605ae5c | [
"MIT"
] | 5 | 2015-10-20T08:31:36.000Z | 2020-09-09T11:56:02.000Z | # coding=utf-8
| 34.222678 | 117 | 0.561734 | # coding=utf-8
import struct
import datetime
from abc import ABCMeta, abstractmethod
from weakref import WeakKeyDictionary
class DWORDValue(object):
"""A descriptor for DWORD values"""
def __init__(self):
self.data = WeakKeyDictionary()
def __get__(self, obj, type):
return stru... | 2 | 4,854 | 0 | 19,864 | 0 | 0 | 0 | 20 | 289 |
fa13cd249d8d04bf26c075693fc1bc4cee02e73e | 15,720 | py | Python | tests/test_12_op_func.py | bitman694/oidctest | dc405530ebee3e442337979fe28a179a23c7926c | [
"Apache-2.0"
] | null | null | null | tests/test_12_op_func.py | bitman694/oidctest | dc405530ebee3e442337979fe28a179a23c7926c | [
"Apache-2.0"
] | null | null | null | tests/test_12_op_func.py | bitman694/oidctest | dc405530ebee3e442337979fe28a179a23c7926c | [
"Apache-2.0"
] | null | null | null | #from oidctest.op.func import redirect_uris_with_query_component
KEYDEFS = [
{"type": "RSA", "key": '', "use": ["sig"]},
{"type": "EC", "crv": "P-256", "use": ["sig"]}
]
# def test_redirect_uris_with_query_component():
# _info = setup_conv()
# oper = AsyncAuthn(_info['conv'], _info['io']... | 33.806452 | 879 | 0.700318 | import json
from oic import rndstr
from oic.utils.keyio import build_keyjar
from otest.check import ERROR
from otest.test_setup import setup_conv
from oidctest.op.func import check_support
from oidctest.op.func import claims_locales
from oidctest.op.func import login_hint
from oidctest.op.func import store_sector_red... | 0 | 0 | 0 | 0 | 0 | 12,995 | 0 | 691 | 1,444 |
9347b1ee1acaf2c23418b01cc644a455cfc6647a | 3,249 | py | Python | vc_buildserver/database/__init__.py | ddevassy/vc-buildserver | 80da7d6c4cc2d104a96900130a845b40adc946e6 | [
"MIT"
] | null | null | null | vc_buildserver/database/__init__.py | ddevassy/vc-buildserver | 80da7d6c4cc2d104a96900130a845b40adc946e6 | [
"MIT"
] | null | null | null | vc_buildserver/database/__init__.py | ddevassy/vc-buildserver | 80da7d6c4cc2d104a96900130a845b40adc946e6 | [
"MIT"
] | null | null | null | # Import In-Built Modules
import logging
log = logging.getLogger(__name__)
| 28.008621 | 94 | 0.637427 | # Import In-Built Modules
import logging
import asyncio
import aiopg.sa
from motor.motor_asyncio import AsyncIOMotorClient
from pymongo import MongoClient
from aiohttp import web
log = logging.getLogger(__name__)
async def init_pg(app: web.Application) -> None:
"""
A function that, when the server is started,... | 0 | 0 | 2,917 | 0 | 0 | 0 | 0 | 28 | 225 |
82f5e3a2098b2efde80e3d5180fe2c7719bd6c2b | 1,624 | py | Python | demo/src/extract_candidate_labels.py | ucla-hci/video-a11y | 42bce0fe166b0c45691f8c2a381fc1bdf779144b | [
"MIT"
] | null | null | null | demo/src/extract_candidate_labels.py | ucla-hci/video-a11y | 42bce0fe166b0c45691f8c2a381fc1bdf779144b | [
"MIT"
] | null | null | null | demo/src/extract_candidate_labels.py | ucla-hci/video-a11y | 42bce0fe166b0c45691f8c2a381fc1bdf779144b | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.load('en_core_web_sm')
path = './GMVbQ1UsMp8.txt'
with open(path, 'r') as file_to_read:
subtitle = file_to_read.read()
doc = nlp(subtitle)
candidate_captions = []
for np in doc.noun_chunks:
print(np.text)
candidate_captions.append(np.text)
import clip
import torch
from torchvis... | 35.304348 | 160 | 0.730296 | import spacy
nlp = spacy.load('en_core_web_sm')
path = './GMVbQ1UsMp8.txt'
with open(path, 'r') as file_to_read:
subtitle = file_to_read.read()
doc = nlp(subtitle)
candidate_captions = []
for np in doc.noun_chunks:
print(np.text)
candidate_captions.append(np.text)
import clip
import torch
from torchvis... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d7448a4814b1b03f14236c291b941745a1b17474 | 338 | py | Python | pokemonfans/migrations/0018_remove_pokemon_description.py | lowdensh/pokefan | 553be197c014f6f145c578b0aececeb06b47016d | [
"MIT"
] | 1 | 2020-11-04T21:14:50.000Z | 2020-11-04T21:14:50.000Z | pokemonfans/migrations/0018_remove_pokemon_description.py | lowdensh/pokefan | 553be197c014f6f145c578b0aececeb06b47016d | [
"MIT"
] | null | null | null | pokemonfans/migrations/0018_remove_pokemon_description.py | lowdensh/pokefan | 553be197c014f6f145c578b0aececeb06b47016d | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-27 20:31
| 18.777778 | 51 | 0.60355 | # Generated by Django 3.1.2 on 2020-10-27 20:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('pokemonfans', '0017_auto_20201027_2028'),
]
operations = [
migrations.RemoveField(
model_name='pokemon',
name='description',... | 0 | 0 | 0 | 232 | 0 | 0 | 0 | 11 | 46 |
ee55fd74cecf372e299b95f182e59846788c14a3 | 8,980 | py | Python | openvizsla/sniffer.py | xairy/pyopenvizsla | 07dd76e5671e9a54c01483f865d68d63437f8225 | [
"BSD-2-Clause"
] | 16 | 2019-06-20T13:31:16.000Z | 2022-01-18T14:36:28.000Z | openvizsla/sniffer.py | xairy/pyopenvizsla | 07dd76e5671e9a54c01483f865d68d63437f8225 | [
"BSD-2-Clause"
] | 1 | 2021-12-06T19:50:38.000Z | 2021-12-06T19:50:38.000Z | openvizsla/sniffer.py | xairy/pyopenvizsla | 07dd76e5671e9a54c01483f865d68d63437f8225 | [
"BSD-2-Clause"
] | 5 | 2020-03-30T21:05:39.000Z | 2022-01-20T18:27:56.000Z | """
Core USB packet sniffer packet backend for OpenVizsla.
"""
| 30.544218 | 118 | 0.479733 | """
Core USB packet sniffer packet backend for OpenVizsla.
"""
import crcmod
from enum import IntFlag
from .protocol import OVPacketHandler
def hd(x):
return " ".join("%02x" % i for i in x)
class USBEventFlags(IntFlag):
""" Enum representing the various flags an OV device can attach to a packet. """
#... | 0 | 459 | 0 | 8,220 | 0 | 32 | 0 | 11 | 183 |
18726d123a1894f010848cc19c8c1ab9ed2153a0 | 286 | py | Python | src/losses/__init__.py | Top-Secrt-Fellows/EVE | 1b67be5331ffd70a9e4f34762535e443908c537e | [
"MIT"
] | 1 | 2021-03-27T08:11:02.000Z | 2021-03-27T08:11:02.000Z | src/losses/__init__.py | Vincen-31/EVE | 1b67be5331ffd70a9e4f34762535e443908c537e | [
"MIT"
] | null | null | null | src/losses/__init__.py | Vincen-31/EVE | 1b67be5331ffd70a9e4f34762535e443908c537e | [
"MIT"
] | null | null | null | from ..losses.cross_entropy import CrossEntropyLoss
from ..losses.euclidean import EuclideanLoss
from ..losses.angular import AngularLoss
from ..losses.mse import MSELoss
from ..losses.l1 import L1Loss
__all__ = ('CrossEntropyLoss', 'EuclideanLoss', 'AngularLoss', 'MSELoss', 'L1Loss') | 40.857143 | 83 | 0.793706 | from ..losses.cross_entropy import CrossEntropyLoss
from ..losses.euclidean import EuclideanLoss
from ..losses.angular import AngularLoss
from ..losses.mse import MSELoss
from ..losses.l1 import L1Loss
__all__ = ('CrossEntropyLoss', 'EuclideanLoss', 'AngularLoss', 'MSELoss', 'L1Loss') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
504177dc265c6436cc9b866f874911a9a32a52dc | 223 | py | Python | src/bindings/python/example.py | alex952/properties | 491fa62c78ea5d6a6c35ba406a59ab1b533a9fab | [
"MIT"
] | 2 | 2018-07-24T08:11:45.000Z | 2018-08-06T15:56:59.000Z | src/bindings/python/example.py | alex952/properties | 491fa62c78ea5d6a6c35ba406a59ab1b533a9fab | [
"MIT"
] | 2 | 2018-10-15T08:00:49.000Z | 2018-10-24T14:29:18.000Z | src/bindings/python/example.py | alex952/properties | 491fa62c78ea5d6a6c35ba406a59ab1b533a9fab | [
"MIT"
] | 5 | 2018-10-18T09:14:57.000Z | 2020-11-12T13:46:25.000Z | #
# Copyright 2014-2018 Neueda Ltd.
#
import Config
props = Config.properties ()
print props.getKeys ()
try:
print props['invalid-key']
except Exception as e:
print e
props['test'] = '1234'
print props['test']
| 12.388889 | 33 | 0.672646 | #
# Copyright 2014-2018 Neueda Ltd.
#
import Config
props = Config.properties ()
print props.getKeys ()
try:
print props['invalid-key']
except Exception as e:
print e
props['test'] = '1234'
print props['test']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
56f8a3b927528eef103f82c3a05a1fce2c790754 | 516 | py | Python | employee_management/templates/pages/temp.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | employee_management/templates/pages/temp.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null | employee_management/templates/pages/temp.py | Vivekananthan112599/Frappe-Vivek | 6a2b70c736e17e9748c6a30e5722341acfb3b5c5 | [
"MIT"
] | null | null | null |
# @frappe.whitelist()
# # def get_wallet():
# # s = frappe.db.get_list('Wallet Transaction', filters={
# # 'docstatus': 1}, fields=['name', 'date', 'customer_name', 'product_price'])
# # return s
| 39.692308 | 99 | 0.507752 | import frappe
# @frappe.whitelist()
# # def get_wallet():
# # s = frappe.db.get_list('Wallet Transaction', filters={
# # 'docstatus': 1}, fields=['name', 'date', 'customer_name', 'product_price'])
# # return s
def get_context(context):
print("****************************//////////////////... | 0 | 0 | 0 | 0 | 0 | 257 | 0 | -8 | 46 |
d942032d07cb4627e2c625c140444615d98609f0 | 3,303 | py | Python | examples/UAVSAR/plot_criteria_rank_estimation.py | antoinecollas/Low-Rank-Statistical-Testing | 934df39f98ccb8c8175c34731f27f8f6d020972b | [
"Apache-2.0"
] | null | null | null | examples/UAVSAR/plot_criteria_rank_estimation.py | antoinecollas/Low-Rank-Statistical-Testing | 934df39f98ccb8c8175c34731f27f8f6d020972b | [
"Apache-2.0"
] | null | null | null | examples/UAVSAR/plot_criteria_rank_estimation.py | antoinecollas/Low-Rank-Statistical-Testing | 934df39f98ccb8c8175c34731f27f8f6d020972b | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Compute rank statistics
# WARNING: will download about 28 Go of data
# Authored by Ammar Mian, 10/01/2019
# e-mail: ammar.mian@centralesupelec.fr
# Modified by Antoine Collas, 10/2019
# e-mail: antoine.collas@centralesupelec.fr
###########... | 36.7 | 125 | 0.659098 | ##############################################################################
# Compute rank statistics
# WARNING: will download about 28 Go of data
# Authored by Ammar Mian, 10/01/2019
# e-mail: ammar.mian@centralesupelec.fr
# Modified by Antoine Collas, 10/2019
# e-mail: antoine.collas@centralesupelec.fr
###########... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 150 | 177 |
96b445f9975b6037d358b6806bbfb97a17fde4f3 | 480 | py | Python | CalibMuon/Configuration/python/RPC_FrontierConditions_IntDB_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CalibMuon/Configuration/python/RPC_FrontierConditions_IntDB_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CalibMuon/Configuration/python/RPC_FrontierConditions_IntDB_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | # The following comments couldn't be translated into the new config version:
#cms_conditions_data/CMS_COND_20X_RPC"
#
#RPC calibrations
#For now, no t0 corrections are applied in the reconstruction if fake calibration is used
#(the replace should be moved to main cfg in order to avoid warning message)
RPCCalibPerf.co... | 34.285714 | 89 | 0.820833 | # The following comments couldn't be translated into the new config version:
#cms_conditions_data/CMS_COND_20X_RPC"
import FWCore.ParameterSet.Config as cms
#
#RPC calibrations
#For now, no t0 corrections are applied in the reconstruction if fake calibration is used
#(the replace should be moved to main cfg in order ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 56 | 44 |
e9a4b6ffb4eb84ca75fef600349898dd41fa808a | 3,107 | py | Python | pos/webpos/models.py | NonnEmilia/OpenGenfri | 7061957fb13ef824763922e1891cb72f7d51bb0f | [
"MIT"
] | null | null | null | pos/webpos/models.py | NonnEmilia/OpenGenfri | 7061957fb13ef824763922e1891cb72f7d51bb0f | [
"MIT"
] | null | null | null | pos/webpos/models.py | NonnEmilia/OpenGenfri | 7061957fb13ef824763922e1891cb72f7d51bb0f | [
"MIT"
] | null | null | null |
# Location class, used to determine from wich actual pos location the cashier
# is working (ex. Bar, restaurant, ...)
# Category class, used as a container for different type of items, related by
# area (ex. Kitchen, beverages, ...)
# Item class, basically the items that we'll sell (ex. Coke, Pizza, Costata,
# ...)... | 33.771739 | 77 | 0.715159 | from django.db import models
from django.contrib.auth.models import User
# Location class, used to determine from wich actual pos location the cashier
# is working (ex. Bar, restaurant, ...)
class Location(models.Model):
id = models.AutoField(primary_key=True)
description = models.CharField(max_length=30)
... | 0 | 61 | 0 | 2,378 | 0 | 0 | 0 | 29 | 159 |
983c9f902a40554b01cebf2de55e79a311044052 | 31,598 | py | Python | scripts/IK_9SEG.py | XiaojiaoChen/origarm_ros | 59d1b05e9c13c50a9281ab2a670621f3f04d8cc1 | [
"MIT"
] | 1 | 2020-04-30T10:05:38.000Z | 2020-04-30T10:05:38.000Z | scripts/IK_9SEG.py | XiaojiaoChen/origarm_ros | 59d1b05e9c13c50a9281ab2a670621f3f04d8cc1 | [
"MIT"
] | 1 | 2020-05-01T08:16:06.000Z | 2020-05-01T08:16:06.000Z | scripts/IK_9SEG.py | XiaojiaoChen/softArmROS | 59d1b05e9c13c50a9281ab2a670621f3f04d8cc1 | [
"MIT"
] | 3 | 2020-04-30T06:48:42.000Z | 2020-05-01T04:27:26.000Z | #!/usr/bin/env python3
#coding=utf-8
import rospy
if __name__ == '__main__':
try:
IK = ik_solver()
print('IK is finished')
except rospy.ServiceException as exc:
print("IK call failed:"+str(exc))
| 57.660584 | 124 | 0.32597 | #!/usr/bin/env python3
#coding=utf-8
import numpy as np
import time
from math import cos, sin, sqrt, pi, atan, asin, atan, atan2
from scipy.optimize import least_squares
from scipy.spatial.transform import Rotation
from angles import normalize_angle
import rospy
from origarm_ros.srv import ik
from origarm_ros.msg impo... | 39 | 0 | 0 | 31,042 | 0 | 0 | 0 | 93 | 222 |
1624e0f73bde28720717fca5571fec7b0bcf2343 | 12,779 | py | Python | pandaserver/taskbuffer/retryModule.py | rybkine/panda-server | 30fdeaa658a38fe2049849446c300c1e1f5b5231 | [
"Apache-2.0"
] | 1 | 2019-08-30T13:47:51.000Z | 2019-08-30T13:47:51.000Z | pandaserver/taskbuffer/retryModule.py | mkycanopus/panda-server | 0f7c36800c033fada8bbde53dceaab98770b6df2 | [
"Apache-2.0"
] | null | null | null | pandaserver/taskbuffer/retryModule.py | mkycanopus/panda-server | 0f7c36800c033fada8bbde53dceaab98770b6df2 | [
"Apache-2.0"
] | null | null | null | from pandalogger.PandaLogger import PandaLogger
import re
from re import error as ReError
# logger
_logger = PandaLogger().getLogger('RetrialModule')
NO_RETRY = 'no_retry'
INCREASE_MEM = 'increase_memory'
LIMIT_RETRY = 'limit_retry'
INCREASE_CPU = 'increase_cputime'
def timeit(method):
"""
Decorator function ... | 47.154982 | 248 | 0.583535 | import sys
import time
from pandalogger.PandaLogger import PandaLogger
from config import panda_config
import re
from re import error as ReError
# logger
_logger = PandaLogger().getLogger('RetrialModule')
NO_RETRY = 'no_retry'
INCREASE_MEM = 'increase_memory'
LIMIT_RETRY = 'limit_retry'
INCREASE_CPU = 'increase_cputim... | 0 | 6,659 | 0 | 0 | 0 | 250 | 0 | -11 | 114 |
7c27f57b382b0aa252a778f4f1a7503a9f3cf8e6 | 4,038 | py | Python | sampler.py | snowbiue/cppn-tensorflow | e7b3a8b715454f55388f0b5f8fdc280ea3433ad0 | [
"MIT"
] | 320 | 2016-03-25T08:18:13.000Z | 2022-01-19T12:27:50.000Z | sampler.py | snowbiue/cppn-tensorflow | e7b3a8b715454f55388f0b5f8fdc280ea3433ad0 | [
"MIT"
] | 2 | 2018-10-19T15:18:15.000Z | 2020-02-29T17:11:37.000Z | sampler.py | snowbiue/cppn-tensorflow | e7b3a8b715454f55388f0b5f8fdc280ea3433ad0 | [
"MIT"
] | 74 | 2016-03-26T13:26:06.000Z | 2022-02-20T21:59:14.000Z | '''
Implementation of Compositional Pattern Producing Networks in Tensorflow
https://en.wikipedia.org/wiki/Compositional_pattern-producing_network
@hardmaru, 2016
Sampler Class
This file is meant to be run inside an IPython session, as it is meant
to be used interacively for experimentation.
It shouldn't be that h... | 34.512821 | 109 | 0.676573 | '''
Implementation of Compositional Pattern Producing Networks in Tensorflow
https://en.wikipedia.org/wiki/Compositional_pattern-producing_network
@hardmaru, 2016
Sampler Class
This file is meant to be run inside an IPython session, as it is meant
to be used interacively for experimentation.
It shouldn't be that h... | 0 | 0 | 0 | 3,156 | 0 | 0 | 0 | -13 | 244 |
e1711b0e278f324882a796ef19c9f32ef865137c | 1,668 | py | Python | identify_image_direction.py | liusanp/simple-rotate-img | 6c75cd85987597998319eef4b38a4d33badc7a58 | [
"Apache-2.0"
] | null | null | null | identify_image_direction.py | liusanp/simple-rotate-img | 6c75cd85987597998319eef4b38a4d33badc7a58 | [
"Apache-2.0"
] | null | null | null | identify_image_direction.py | liusanp/simple-rotate-img | 6c75cd85987597998319eef4b38a4d33badc7a58 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from gevent.pywsgi import WSGIServer
import traceback
app = Flask(__name__)
def run(ser_port=1666):
"""
:param ser_port:
:return:
"""
api_server = None
try:
api_server = WSGIServer(('0.0.0.0', ser_port), app)
api_server.log.write(f' http://127.0.0... | 27.8 | 120 | 0.594125 | from flask import Flask, request, jsonify
from gevent.pywsgi import WSGIServer
import traceback
import uuid
import os
from logger import logger
from boundingRect import detect
import cv2
app = Flask(__name__)
@app.route('/identifyDirection', methods=['POST'])
def get_direction():
"""
图片方向识别
:return:
... | 87 | 923 | 0 | 0 | 0 | 0 | 0 | -1 | 133 |
be273e7b31ee9fbc2fb60358bb41cd8579064892 | 6,475 | py | Python | asce7/v2016/chapter29.py | Ricyteach/asce7 | 65dc0a3011203fbcb2e3e4a5b31be8e2f124976f | [
"MIT"
] | null | null | null | asce7/v2016/chapter29.py | Ricyteach/asce7 | 65dc0a3011203fbcb2e3e4a5b31be8e2f124976f | [
"MIT"
] | null | null | null | asce7/v2016/chapter29.py | Ricyteach/asce7 | 65dc0a3011203fbcb2e3e4a5b31be8e2f124976f | [
"MIT"
] | null | null | null | """CHAPTER 29
WIND LOADS ON BUILDING APPURTENANCES AND OTHER STRUCTURES:
MAIN WIND FORCE RESISTING SYSTEM (DIRECTIONAL PROCEDURE)
Basic wind speed, V (Section 26.5);
Wind directionality factor, Kd (Section 26.6);
Exposure category (Section 26.7);
Topographic factor, Kzt (Section 26.8);
Ground elevation factor, Ke... | 30.542453 | 117 | 0.55027 | """CHAPTER 29
WIND LOADS ON BUILDING APPURTENANCES AND OTHER STRUCTURES:
MAIN WIND FORCE RESISTING SYSTEM (DIRECTIONAL PROCEDURE)
• Basic wind speed, V (Section 26.5);
• Wind directionality factor, Kd (Section 26.6);
• Exposure category (Section 26.7);
• Topographic factor, Kzt (Section 26.8);
• Ground elevation facto... | 184 | 1,811 | 0 | 0 | 0 | 0 | 0 | 0 | 207 |
b503b88316df20925d7e75dc32992d0527743735 | 4,124 | py | Python | blastsight/model/utils.py | gsanhueza/BlastSight | 4b5c48e7ea5f67b737429f05d5213e9ff1fd399d | [
"MIT"
] | null | null | null | blastsight/model/utils.py | gsanhueza/BlastSight | 4b5c48e7ea5f67b737429f05d5213e9ff1fd399d | [
"MIT"
] | 1 | 2022-03-13T17:35:35.000Z | 2022-03-13T17:35:35.000Z | blastsight/model/utils.py | gsanhueza/BlastSight | 4b5c48e7ea5f67b737429f05d5213e9ff1fd399d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2019-2021 Gabriel Sanhueza.
#
# Distributed under the MIT License.
# See LICENSE for more info.
| 26.606452 | 94 | 0.595538 | #!/usr/bin/env python
# Copyright (c) 2019-2021 Gabriel Sanhueza.
#
# Distributed under the MIT License.
# See LICENSE for more info.
import numpy as np
from colour import Color
def magnitude(vector: np.ndarray) -> float:
return np.linalg.norm(vector)
def normalize(vector: np.ndarray) -> np.ndarray:
r... | 0 | 0 | 0 | 0 | 0 | 3,652 | 0 | 0 | 322 |
7ce43739563daa9d0b8bf884c297d9f50f5705be | 4,749 | py | Python | tests/test_rfc5751.py | alvistack/etingof-pyasn1-modules | bdbcc5d9650a8e8382979f089df3307dd4121b49 | [
"BSD-2-Clause"
] | 34 | 2016-04-03T09:10:31.000Z | 2022-02-12T20:38:31.000Z | tests/test_rfc5751.py | alvistack/etingof-pyasn1-modules | bdbcc5d9650a8e8382979f089df3307dd4121b49 | [
"BSD-2-Clause"
] | 138 | 2017-05-31T09:25:10.000Z | 2022-02-07T09:00:19.000Z | tests/test_rfc5751.py | alvistack/etingof-pyasn1-modules | bdbcc5d9650a8e8382979f089df3307dd4121b49 | [
"BSD-2-Clause"
] | 36 | 2016-03-16T00:37:04.000Z | 2021-11-12T12:09:43.000Z | #
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
import unittest
suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__])
if __name__ == '__main__':
result = uni... | 45.663462 | 98 | 0.787534 | #
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
import unittest
from pyasn1.codec.der.decoder import decode as der_decoder
from pyasn1.codec.der.encoder import encode as der_encoder
f... | 0 | 0 | 0 | 4,070 | 0 | 0 | 0 | 116 | 157 |
ba7a7f5e07b2f50227a9c41fe73ef0dfe7c67fc3 | 2,206 | py | Python | Trials_Practice/Upload_csv.py | ikhedr/flask_api | 7c9260761fc8e6faf1c06393c2b353046759a504 | [
"MIT"
] | null | null | null | Trials_Practice/Upload_csv.py | ikhedr/flask_api | 7c9260761fc8e6faf1c06393c2b353046759a504 | [
"MIT"
] | null | null | null | Trials_Practice/Upload_csv.py | ikhedr/flask_api | 7c9260761fc8e6faf1c06393c2b353046759a504 | [
"MIT"
] | null | null | null |
from flask import Flask
from flask_pymongo import PyMongo
app = Flask(__name__,template_folder='templates')
#Database name
app.config['MONGO_DBNAME'] = 'tickets'
# use mlab.com to take temperory dbs
#mongodb://<dbuser>:<dbpassword>@ds241012.mlab.com:41012/DatabaseName
app.config['MONGO_URI'] = 'mongo... | 27.234568 | 97 | 0.614234 |
from flask import Flask, make_response, request, render_template, jsonify
import io
import csv
from flask_pymongo import PyMongo
import pandas as pd
import json
from bson import ObjectId
class JSONEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, ObjectId):
return s... | 0 | 1,250 | 0 | 156 | 0 | 62 | 0 | 19 | 239 |
6bdfdf4be7e83844f47e16b120d585a3a134532e | 1,408 | py | Python | tests/test_cron_parsing.py | koaning/skedulord | dcd505b3f1ce554bb380464a95f2a2e3ced915ba | [
"MIT"
] | 26 | 2019-10-18T11:44:58.000Z | 2021-07-18T19:14:50.000Z | tests/test_cron_parsing.py | koaning/skedulord | dcd505b3f1ce554bb380464a95f2a2e3ced915ba | [
"MIT"
] | 31 | 2019-10-18T10:17:03.000Z | 2021-07-20T18:40:31.000Z | tests/test_cron_parsing.py | koaning/skedulord | dcd505b3f1ce554bb380464a95f2a2e3ced915ba | [
"MIT"
] | 3 | 2019-10-24T17:39:11.000Z | 2021-07-19T22:58:14.000Z | from skedulord.cron import Cron
checks = [
{
"name": "foo",
"command": "python foobar.py",
"arguments": {"hello": "world"},
"expected": "python foobar.py --hello world",
},
{
"name": "foo",
"command": "python foobar.py",
"arguments": {"hello": "world"... | 31.288889 | 69 | 0.589489 | import pytest
from skedulord.cron import parse_job_from_settings, Cron
checks = [
{
"name": "foo",
"command": "python foobar.py",
"arguments": {"hello": "world"},
"expected": "python foobar.py --hello world",
},
{
"name": "foo",
"command": "python foobar.py",... | 0 | 215 | 0 | 0 | 0 | 0 | 0 | 17 | 45 |
f4a5bfd3e7304c0be1b2b645ff0a8eae130a1af0 | 1,354 | py | Python | src/example_lambda_switch_GYQ.py | ShuhuaGao/bcn_ss | 7f0a46e1ed94e6c4d9df114e8d241b61dc551d85 | [
"MIT"
] | null | null | null | src/example_lambda_switch_GYQ.py | ShuhuaGao/bcn_ss | 7f0a46e1ed94e6c4d9df114e8d241b61dc551d85 | [
"MIT"
] | null | null | null | src/example_lambda_switch_GYQ.py | ShuhuaGao/bcn_ss | 7f0a46e1ed94e6c4d9df114e8d241b61dc551d85 | [
"MIT"
] | null | null | null | """
The BCN example for the $\lambda$ switch genetic network.
Solved using the algebraic method developed by Yuqian Guo etc.
Guo, Yuqian, Pan Wang, Weihua Gui, and Chunhua Yang. "Set stability and set stabilization of Boolean control networks
based on invariant subsets." Automatica 61 (2015): 106-112.
Please refer to... | 45.133333 | 130 | 0.733383 | """
The BCN example for the $\lambda$ switch genetic network.
Solved using the algebraic method developed by Yuqian Guo etc.
Guo, Yuqian, Pan Wang, Weihua Gui, and Chunhua Yang. "Set stability and set stabilization of Boolean control networks
based on invariant subsets." Automatica 61 (2015): 106-112.
Please refer to... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 22 |
8a7b49d233c311a1f29d4384c84df96155c78959 | 1,594 | py | Python | compiler/drc/drc_lut.py | bsg-external/OpenRAM | 3c5e13f95c925a204cabf052525c3de07638168f | [
"BSD-3-Clause"
] | 2 | 2019-12-30T11:41:21.000Z | 2020-02-15T00:15:32.000Z | compiler/drc/drc_lut.py | bsg-external/OpenRAM | 3c5e13f95c925a204cabf052525c3de07638168f | [
"BSD-3-Clause"
] | null | null | null | compiler/drc/drc_lut.py | bsg-external/OpenRAM | 3c5e13f95c925a204cabf052525c3de07638168f | [
"BSD-3-Clause"
] | null | null | null | # See LICENSE for licensing information.
#
# Copyright (c) 2016-2019 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
| 31.254902 | 81 | 0.611669 | # See LICENSE for licensing information.
#
# Copyright (c) 2016-2019 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import debug
class drc_lut():
"""
Impl... | 0 | 0 | 0 | 1,245 | 0 | 0 | 0 | -9 | 45 |
887641a2bebb998c21c8e920bef147a42f4da788 | 3,779 | py | Python | traits_futures/testing/test_assistant.py | enthought/traits-futures | 4b20376d95e83a76d77ce10e024ec4527c27d5d0 | [
"BSD-3-Clause"
] | 10 | 2019-02-08T15:52:18.000Z | 2021-12-14T03:13:41.000Z | traits_futures/testing/test_assistant.py | enthought/traits-futures | 4b20376d95e83a76d77ce10e024ec4527c27d5d0 | [
"BSD-3-Clause"
] | 244 | 2019-02-05T17:18:15.000Z | 2022-03-12T10:55:20.000Z | traits_futures/testing/test_assistant.py | enthought/traits-futures | 4b20376d95e83a76d77ce10e024ec4527c27d5d0 | [
"BSD-3-Clause"
] | 1 | 2021-07-06T07:18:21.000Z | 2021-07-06T07:18:21.000Z | # (C) Copyright 2018-2021 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... | 35.317757 | 78 | 0.686954 | # (C) Copyright 2018-2021 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... | 0 | 0 | 0 | 2,899 | 0 | 0 | 0 | 64 | 92 |
7c0f286a698be8772e172df54c301fbd5008684f | 53,604 | py | Python | src/dsloader/graphrnn_data.py | willshiao/brgan | 99d1627176a59811bf9032ef1f99d6e7261095fb | [
"MIT"
] | 1 | 2021-10-03T15:58:48.000Z | 2021-10-03T15:58:48.000Z | src/dsloader/graphrnn_data.py | willshiao/brgan | 99d1627176a59811bf9032ef1f99d6e7261095fb | [
"MIT"
] | null | null | null | src/dsloader/graphrnn_data.py | willshiao/brgan | 99d1627176a59811bf9032ef1f99d6e7261095fb | [
"MIT"
] | null | null | null | # From https://github.com/snap-stanford/GraphRNN/blob/1ef475d957414d7c0bf8c778a1d44cb52dd7829b/data.py
import torch.nn as nn
import networkx as nx
import pickle as pkl
import scipy.sparse as sp
# load ENZYMES and PROTEIN and DD dataset
def Graph_load_batch(min_num_nodes = 20, max_num_nodes = 1000, name = 'ENZYMES',... | 38.956395 | 148 | 0.611876 | # From https://github.com/snap-stanford/GraphRNN/blob/1ef475d957414d7c0bf8c778a1d44cb52dd7829b/data.py
import torch
import torchvision as tv
import torch.nn as nn
from torch.autograd import Variable
import matplotlib.pyplot as plt
from random import shuffle
import networkx as nx
import pickle as pkl
import scipy.spar... | 0 | 0 | 0 | 35,587 | 0 | 4,917 | 0 | -14 | 644 |
aaaaed43af8bc3be6a42b68a13f8d1b6417e9d1b | 7,581 | py | Python | bob/db/iris/example/backprop.py | bioidiap/bob.db.iris | beadb65ec2d978ea1c7fd300ff107646f3137c4e | [
"BSD-3-Clause"
] | null | null | null | bob/db/iris/example/backprop.py | bioidiap/bob.db.iris | beadb65ec2d978ea1c7fd300ff107646f3137c4e | [
"BSD-3-Clause"
] | 1 | 2016-07-29T13:33:22.000Z | 2016-07-29T14:53:35.000Z | bob/db/iris/example/backprop.py | bioidiap/bob.db.iris | beadb65ec2d978ea1c7fd300ff107646f3137c4e | [
"BSD-3-Clause"
] | 2 | 2016-03-08T11:17:50.000Z | 2018-05-17T14:46:39.000Z | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Andre Anjos <andre.anjos@idiap.ch>
# Tue Jul 19 11:50:08 2011 +0200
#
# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
"""This example shows how to use the Iris Flower (Fisher's) Dataset to create
3-class classifier based on Neural Networ... | 31.197531 | 106 | 0.673262 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Andre Anjos <andre.anjos@idiap.ch>
# Tue Jul 19 11:50:08 2011 +0200
#
# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
"""This example shows how to use the Iris Flower (Fisher's) Dataset to create
3-class classifier based on Neural Networ... | 0 | 0 | 0 | 0 | 0 | 980 | 0 | -24 | 109 |
7d30be9bcf9233d87b2105366e0d928691d092d6 | 2,831 | py | Python | dron_services/servicio_videos.py | ppsirg/arqbot | ee0a5f0517fc3676d8073c1b1d88268aac88cc94 | [
"MIT"
] | null | null | null | dron_services/servicio_videos.py | ppsirg/arqbot | ee0a5f0517fc3676d8073c1b1d88268aac88cc94 | [
"MIT"
] | 4 | 2021-03-10T13:15:34.000Z | 2022-02-27T02:22:05.000Z | dron_services/servicio_videos.py | ppsirg/arqbot | ee0a5f0517fc3676d8073c1b1d88268aac88cc94 | [
"MIT"
] | 1 | 2020-04-02T16:24:34.000Z | 2020-04-02T16:24:34.000Z | """
Servicio videos.
"""
import os
rootFolder = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
# load placeholder image for video widget
with open('src/assets/placeholder.jpeg', 'br') as t:
cat_jpg = t.read()
| 33.702381 | 89 | 0.614977 | """
Servicio videos.
"""
from tornado.web import RequestHandler
from tornado.gen import sleep
from tornado.ioloop import IOLoop
from tornado.httpclient import AsyncHTTPClient, HTTPRequest
from time import time
import os
from subprocess import call
rootFolder = os.path.dirname(os.path.abspath(os.path.dirname(__file__)... | 0 | 0 | 1,743 | 617 | 0 | 0 | 0 | 81 | 155 |
c43ee33f35fefa6284437e2cea1456c51977314a | 5,543 | py | Python | scripts/tebreak/tebreak_post.py | TalRichter/mcclintock | 93369eff1c192132d8b27830310d149e53a2b608 | [
"Unlicense"
] | 62 | 2015-01-18T15:30:48.000Z | 2022-03-06T08:23:40.000Z | scripts/tebreak/tebreak_post.py | TalRichter/mcclintock | 93369eff1c192132d8b27830310d149e53a2b608 | [
"Unlicense"
] | 49 | 2015-01-20T12:57:45.000Z | 2022-03-22T15:05:46.000Z | scripts/tebreak/tebreak_post.py | TalRichter/mcclintock | 93369eff1c192132d8b27830310d149e53a2b608 | [
"Unlicense"
] | 28 | 2015-01-21T21:14:46.000Z | 2022-02-20T21:43:31.000Z | import sys
import importlib.util as il
spec = il.spec_from_file_location("config", snakemake.params.config)
config = il.module_from_spec(spec)
sys.modules[spec.name] = config
spec.loader.exec_module(config)
sys.path.append(snakemake.config['args']['mcc_path'])
import scripts.mccutils as mccutils
import scripts.output a... | 54.343137 | 125 | 0.655962 | import os
import sys
import subprocess
import importlib.util as il
spec = il.spec_from_file_location("config", snakemake.params.config)
config = il.module_from_spec(spec)
sys.modules[spec.name] = config
spec.loader.exec_module(config)
sys.path.append(snakemake.config['args']['mcc_path'])
import scripts.mccutils as mccu... | 0 | 0 | 0 | 0 | 0 | 5,083 | 0 | -16 | 90 |
53b59309701b2e3c3cf1f30105681dee5303295e | 35 | py | Python | homeassistant/components/clicksend_tts/__init__.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/clicksend_tts/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/clicksend_tts/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """The clicksend_tts component."""
| 17.5 | 34 | 0.714286 | """The clicksend_tts component."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3c97dfea60504a48b67c6df474b86cb87dcbf717 | 5,175 | py | Python | registry/views.py | gutma-org/droneregistry | 4be915d8cd3b8217564e9b3bf18c4a24c2d42208 | [
"Apache-2.0"
] | 4 | 2018-09-30T06:46:25.000Z | 2019-10-17T03:17:32.000Z | registry/views.py | gutma-org/droneregistry | 4be915d8cd3b8217564e9b3bf18c4a24c2d42208 | [
"Apache-2.0"
] | 4 | 2019-04-29T14:25:40.000Z | 2020-01-31T08:52:52.000Z | registry/views.py | gutma-org/droneregistry | 4be915d8cd3b8217564e9b3bf18c4a24c2d42208 | [
"Apache-2.0"
] | 2 | 2019-07-08T12:39:47.000Z | 2020-12-13T10:13:05.000Z | import datetime
| 27.673797 | 107 | 0.724444 | import datetime
import json
from datetime import datetime
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render
from django.template import loader
from django.utils import translation
from django.views.generic import Templat... | 0 | 0 | 0 | 3,655 | 0 | 0 | 0 | 776 | 719 |
daad79d386573062cf106741bc31d87803aa2aa7 | 1,269 | py | Python | extras/migrations/0001_initial.py | ayushganguli1769/DevelopmentRobotix | 1692c104a6f220aa1238840b791aa857a6cc7765 | [
"Apache-2.0"
] | null | null | null | extras/migrations/0001_initial.py | ayushganguli1769/DevelopmentRobotix | 1692c104a6f220aa1238840b791aa857a6cc7765 | [
"Apache-2.0"
] | 7 | 2020-02-12T02:54:35.000Z | 2022-03-12T00:06:26.000Z | extras/migrations/0001_initial.py | ayushganguli1769/DevelopmentRobotix | 1692c104a6f220aa1238840b791aa857a6cc7765 | [
"Apache-2.0"
] | 6 | 2020-02-10T16:37:38.000Z | 2021-01-28T13:39:46.000Z | # Generated by Django 2.1.7 on 2019-11-23 10:11
| 34.297297 | 114 | 0.541371 | # Generated by Django 2.1.7 on 2019-11-23 10:11
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='DIY',
fields=[
('id', models.AutoField(auto... | 0 | 0 | 0 | 1,155 | 0 | 0 | 0 | 19 | 46 |
42f49270e5c8c76ba8f0b3d3bec8fee6c4419a61 | 4,707 | py | Python | csv_to_html_with_template.py | ma0c/csv_to_html | 7685a384b35b7d12d80ca99e2c118fd7172a03a3 | [
"MIT"
] | null | null | null | csv_to_html_with_template.py | ma0c/csv_to_html | 7685a384b35b7d12d80ca99e2c118fd7172a03a3 | [
"MIT"
] | null | null | null | csv_to_html_with_template.py | ma0c/csv_to_html | 7685a384b35b7d12d80ca99e2c118fd7172a03a3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import logging
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.StreamHandler())
if __name__ == '__main__':
parser = argparse.ArgumentParser("""
The objective of this script is to transform a given row of a CSV into an HTML, that could be printed via a brow... | 35.931298 | 125 | 0.650096 | #!/usr/bin/env python
import argparse
import csv
import itertools
import logging
import os
import tkinter as tk
from tkinter import filedialog
from tkinter import messagebox
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.StreamHandler())
def generate_html(input_file_path, template_file_path, output... | 0 | 0 | 0 | 2,560 | 0 | 909 | 0 | -11 | 202 |
c0633a02cf59be1d64dde1cbe349bd83ad3c872f | 514 | py | Python | HackerEarth/Hashing/N_Coordinates_Pair.py | GSri30/Competetive_programming | 0dc1681500a80b6f0979d0dc9f749357ee07bcb8 | [
"MIT"
] | 22 | 2020-01-03T17:32:00.000Z | 2021-11-07T09:31:44.000Z | HackerEarth/Hashing/N_Coordinates_Pair.py | GSri30/Competetive_programming | 0dc1681500a80b6f0979d0dc9f749357ee07bcb8 | [
"MIT"
] | 10 | 2020-09-30T09:41:18.000Z | 2020-10-11T11:25:09.000Z | HackerEarth/Hashing/N_Coordinates_Pair.py | GSri30/Competetive_programming | 0dc1681500a80b6f0979d0dc9f749357ee07bcb8 | [
"MIT"
] | 25 | 2019-10-14T19:25:01.000Z | 2021-05-26T08:12:20.000Z | # Write your code here
if __name__ == "__main__":
n = int(input())
l = []
while n > 0 :
x,y = map(int,input().split())
l.append((x,y))
n -= 1
dict = {}
for i in l :
if i in dict :
dict[i] += 1
else :
dict[i] = 1
for i,j in sorted(... | 19.037037 | 39 | 0.449416 | # Write your code here
import math
import numpy as np
import itertools
if __name__ == "__main__":
n = int(input())
l = []
while n > 0 :
x,y = map(int,input().split())
l.append((x,y))
n -= 1
dict = {}
for i in l :
if i in dict :
dict[i] += 1
else... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -18 | 68 |
3b1ea9bc06a958721fe96a8b69eddcb82bf30765 | 1,157 | py | Python | scripts/eeutils/verilog_to_latex.py | shulinye/dotfiles | a342512c33ca102d03921cc653ee4605d0cf9617 | [
"MIT"
] | 2 | 2015-01-16T22:07:10.000Z | 2015-11-09T06:45:44.000Z | scripts/eeutils/verilog_to_latex.py | shulinye/dotfiles | a342512c33ca102d03921cc653ee4605d0cf9617 | [
"MIT"
] | 4 | 2015-07-08T19:13:47.000Z | 2015-08-31T16:04:36.000Z | scripts/eeutils/verilog_to_latex.py | shulinye/dotfiles | a342512c33ca102d03921cc653ee4605d0cf9617 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.realpath(__file__))))
if __name__ == '__main__':
| 28.219512 | 68 | 0.550562 | #!/usr/bin/env python3
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.realpath(__file__))))
from pythonutils import gen_diffs
def verilog_to_latex_timetable(filename, scale=None):
mapping = {'x':'U','1':'H','0':'L'}
lines = open(filename).readlines()
f = list(zip(*[i.strip... | 0 | 0 | 0 | 0 | 903 | 0 | 0 | 6 | 95 |
59c444b0b651be09f3bcc3ed39fcb210bedd8138 | 1,576 | py | Python | native/jni/external/selinux/python/sepolicy/sepolicy/booleans.py | Joyoe/Magisk-nosbin_magisk-nohide | 449441921740bf85926c14f41b3532822ca0eb65 | [
"MIT"
] | 2 | 2022-01-16T00:59:54.000Z | 2022-02-09T12:00:48.000Z | native/jni/external/selinux/python/sepolicy/sepolicy/booleans.py | Joyoe/Magisk-nosbin_magisk-nohide | 449441921740bf85926c14f41b3532822ca0eb65 | [
"MIT"
] | null | null | null | native/jni/external/selinux/python/sepolicy/sepolicy/booleans.py | Joyoe/Magisk-nosbin_magisk-nohide | 449441921740bf85926c14f41b3532822ca0eb65 | [
"MIT"
] | 2 | 2022-02-09T12:00:39.000Z | 2022-02-21T18:34:46.000Z | # Copyright (C) 2012 Red Hat
# see file 'COPYING' for use and warranty information
#
# setrans is a tool for analyzing process transitions in SELinux policy
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free... | 38.439024 | 116 | 0.689721 | # Copyright (C) 2012 Red Hat
# see file 'COPYING' for use and warranty information
#
# setrans is a tool for analyzing process transitions in SELinux policy
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free... | 0 | 0 | 0 | 0 | 0 | 576 | 0 | -6 | 68 |
b9141e751450f23c9cef1e13fa6a61eea3ac54cd | 787 | py | Python | data/build_dict.py | valentindey/parallel-nmt | 7f4ea8cc343bc287a41c7137234c5b8c50e8cc29 | [
"MIT"
] | 1 | 2017-05-03T22:41:00.000Z | 2017-05-03T22:41:00.000Z | data/build_dict.py | valentindey/parallel-nmt | 7f4ea8cc343bc287a41c7137234c5b8c50e8cc29 | [
"MIT"
] | null | null | null | data/build_dict.py | valentindey/parallel-nmt | 7f4ea8cc343bc287a41c7137234c5b8c50e8cc29 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# generates a dictionary in json format, with the
if __name__ == "__main__":
get_dict()
| 24.59375 | 77 | 0.673443 | #! /usr/bin/env python
# generates a dictionary in json format, with the
import json
from collections import Counter
import click
@click.command()
@click.argument("input-file", type=click.Path(exists=True, dir_okay=False))
@click.argument("output-file", type=click.Path(exists=False, dir_okay=False))
@click.option(... | 0 | 586 | 0 | 0 | 0 | 0 | 0 | -9 | 91 |
a207f491314f5358ca796d65f48b7de02bd8ef96 | 5,211 | py | Python | vm_network_migration/handlers/backend_service_migration/global_backend_service_migration.py | googleinterns/vm-network-migration | 1132e44d696ab9da4d1079ebc3d32ed4382cdc28 | [
"Apache-2.0"
] | 1 | 2020-05-27T00:30:47.000Z | 2020-05-27T00:30:47.000Z | vm_network_migration/handlers/backend_service_migration/global_backend_service_migration.py | yueMaHello/vm-network-migration | 4a6bdbb2952fb8ee8022b5c0452159329a79e953 | [
"Apache-2.0"
] | 1 | 2020-06-03T15:51:20.000Z | 2020-06-03T15:51:20.000Z | vm_network_migration/handlers/backend_service_migration/global_backend_service_migration.py | yueMaHello/vm-network-migration | 4a6bdbb2952fb8ee8022b5c0452159329a79e953 | [
"Apache-2.0"
] | 3 | 2020-06-03T15:17:00.000Z | 2020-06-20T08:39:50.000Z | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 44.161017 | 106 | 0.631741 | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 1,135 | 0 | 2,973 | 0 | 0 | 0 | 268 | 112 |
bb55e369cdbe339f05b27a95ade41b35b65ca73c | 4,186 | py | Python | dev0s/classes/requests/__init__.py | vandenberghinc/dev0s | 1c9629e2a81ad111fd3e74929aaeb05c97be0276 | [
"MIT"
] | 1 | 2021-03-09T20:14:29.000Z | 2021-03-09T20:14:29.000Z | dev0s/classes/requests/__init__.py | vandenberghinc/dev0s | 1c9629e2a81ad111fd3e74929aaeb05c97be0276 | [
"MIT"
] | null | null | null | dev0s/classes/requests/__init__.py | vandenberghinc/dev0s | 1c9629e2a81ad111fd3e74929aaeb05c97be0276 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# imports.
# pip imports.
# the requests class.
# initialized classes.
requests = Requests()
#
| 27.721854 | 172 | 0.671763 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# imports.
from dev0s.classes.response import *
from dev0s.classes.defaults import objects
from dev0s.classes.response import response as _response_
# pip imports.
from bs4 import BeautifulSoup as bs4
import urllib
import requests as __requests__
# the requests class.
c... | 0 | 0 | 0 | 3,796 | 0 | 0 | 0 | 89 | 154 |
676efc672a854428d7b8e4db3710def76c588c68 | 3,739 | py | Python | accelerators/extract_transform_load/test/save_events.py | antara678/aws-iot-greengrass-accelerators | f3a747fa15013a488313bfc2fc463e9fa75c7b07 | [
"MIT-0"
] | 47 | 2019-09-13T09:22:44.000Z | 2022-03-04T12:19:03.000Z | accelerators/extract_transform_load/test/save_events.py | antara678/aws-iot-greengrass-accelerators | f3a747fa15013a488313bfc2fc463e9fa75c7b07 | [
"MIT-0"
] | 5 | 2020-04-13T02:43:47.000Z | 2021-11-16T19:44:22.000Z | accelerators/extract_transform_load/test/save_events.py | antara678/aws-iot-greengrass-accelerators | f3a747fa15013a488313bfc2fc463e9fa75c7b07 | [
"MIT-0"
] | 27 | 2019-09-13T18:19:42.000Z | 2022-02-21T21:13:32.000Z | #!/usr/bin/env python
"""Extracts messages from CAN Bus interface and save to file"""
import os
import time
import threading
import queue
import can
from can import Message
# List of OBD-II parameter Ids to query
PIDS = {
"vehicle_speed": Message(
arbitration_id=0x7DF,
extended_id=False,
... | 28.761538 | 96 | 0.635197 | #!/usr/bin/env python
"""Extracts messages from CAN Bus interface and save to file"""
import os
import time
import threading
import queue
import zipfile
import can
from can import Message
# List of OBD-II parameter Ids to query
PIDS = {
"vehicle_speed": Message(
arbitration_id=0x7DF,
extended_id=... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -7 | 22 |
5d89f77812ea91179a7117b011b27c5dde6bd79d | 248 | py | Python | site-packages/psycopg2cffi/_impl/libpq.py | cdepman/falcon_api | 42d2ec646a8af5c4bd62460af5a227c805d0a825 | [
"MIT"
] | null | null | null | site-packages/psycopg2cffi/_impl/libpq.py | cdepman/falcon_api | 42d2ec646a8af5c4bd62460af5a227c805d0a825 | [
"MIT"
] | null | null | null | site-packages/psycopg2cffi/_impl/libpq.py | cdepman/falcon_api | 42d2ec646a8af5c4bd62460af5a227c805d0a825 | [
"MIT"
] | null | null | null | try:
from psycopg2cffi._impl._libpq import ffi, lib as libpq
except ImportError:
from psycopg2cffi._impl._build_libpq import ffi, C_SOURCE, C_SOURCE_KWARGS
libpq = ffi.verify(C_SOURCE, **C_SOURCE_KWARGS)
PG_VERSION = libpq._PG_VERSION
| 31 | 78 | 0.782258 | try:
from psycopg2cffi._impl._libpq import ffi, lib as libpq
except ImportError:
from psycopg2cffi._impl._build_libpq import ffi, C_SOURCE, C_SOURCE_KWARGS
libpq = ffi.verify(C_SOURCE, **C_SOURCE_KWARGS)
PG_VERSION = libpq._PG_VERSION
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dc4670578de7ec629c7aeff2917612d2a77e5d4a | 23,694 | py | Python | usaspending_api/bulk_download/tests/test_download.py | bminahankcfrb/usaspending-api | 1fb5c4c261edf91ab2930aea7928ca24dfa49123 | [
"CC0-1.0"
] | null | null | null | usaspending_api/bulk_download/tests/test_download.py | bminahankcfrb/usaspending-api | 1fb5c4c261edf91ab2930aea7928ca24dfa49123 | [
"CC0-1.0"
] | null | null | null | usaspending_api/bulk_download/tests/test_download.py | bminahankcfrb/usaspending-api | 1fb5c4c261edf91ab2930aea7928ca24dfa49123 | [
"CC0-1.0"
] | null | null | null | import json
from rest_framework import status
def test_list_agencies(client, award_data):
"""Test transaction list agencies endpoint"""
resp = client.post(
"/api/v2/bulk_download/list_agencies",
content_type="application/json",
data=json.dumps({"type": "award_agencies"}),
... | 33.046025 | 120 | 0.644805 | import json
import pytest
from model_mommy import mommy
from rest_framework import status
from unittest.mock import Mock
from usaspending_api.awards.models import (
TransactionNormalized,
TransactionFABS,
TransactionFPDS,
Subaward,
BrokerSubaward,
)
from usaspending_api.awards.v2.lookups.lookups i... | 0 | 13,725 | 0 | 0 | 0 | 8,019 | 0 | 399 | 476 |
de039b35d092eaddc2b6f0193a2d900be0fc584b | 7,645 | py | Python | art_generation/model.py | IDmy/deep-learning-models | ab8777258aa2023f203b9292355949ba8965c198 | [
"MIT"
] | 1 | 2018-05-06T18:50:09.000Z | 2018-05-06T18:50:09.000Z | art_generation/model.py | IDmy/deep-learning-models | ab8777258aa2023f203b9292355949ba8965c198 | [
"MIT"
] | null | null | null | art_generation/model.py | IDmy/deep-learning-models | ab8777258aa2023f203b9292355949ba8965c198 | [
"MIT"
] | null | null | null | import scipy.io
import scipy.misc
from matplotlib.pyplot import imshow
from PIL import Image
import tensorflow as tf
def content_cost(a_C, a_G):
"""
Computes the content cost
Arguments:
a_C -- tensor of dimension (1, n_H, n_W, n_C), hidden layer activations representing content of the image C
... | 31.204082 | 124 | 0.678613 | import os
import sys
import scipy.io
import scipy.misc
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow
from PIL import Image
from utils import *
import numpy as np
import tensorflow as tf
def content_cost(a_C, a_G):
"""
Computes the content cost
Arguments:
a_C -- tensor of di... | 0 | 0 | 0 | 0 | 0 | 1,197 | 0 | -18 | 133 |
69fb7e42e2d590adba3677bed7a63c7c09bcbca3 | 2,032 | py | Python | mentorbot/MenteeRequests/migrations/0002_auto_20180721_1600.py | MentorBot/Webhook | 696ce15f41d1c15a6cae336c41f3e56e4a3e5056 | [
"Unlicense"
] | 2 | 2018-06-04T10:46:09.000Z | 2020-06-02T14:48:44.000Z | mentorbot/MenteeRequests/migrations/0002_auto_20180721_1600.py | MentorBot/Webhook | 696ce15f41d1c15a6cae336c41f3e56e4a3e5056 | [
"Unlicense"
] | 4 | 2018-07-18T13:16:50.000Z | 2021-09-07T23:41:25.000Z | mentorbot/MenteeRequests/migrations/0002_auto_20180721_1600.py | MentorBot/Webhook | 696ce15f41d1c15a6cae336c41f3e56e4a3e5056 | [
"Unlicense"
] | null | null | null | # Generated by Django 2.0.2 on 2018-07-21 16:00
| 36.285714 | 151 | 0.59498 | # Generated by Django 2.0.2 on 2018-07-21 16:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('MentorDetails', '0003_auto_20180721_1600'),
('MenteeRequests', '0001_initial'),
]
operations = [
mi... | 0 | 0 | 0 | 1,885 | 0 | 0 | 0 | 30 | 68 |
82dac7b29f41675e49947a6befb26517c5d70064 | 1,352 | py | Python | Python/logest_vowel_chain.py | shloch/CODING_PRACTICE | c79ed3c2b576d133fd7a446b0fd954362cf54b22 | [
"MIT"
] | null | null | null | Python/logest_vowel_chain.py | shloch/CODING_PRACTICE | c79ed3c2b576d133fd7a446b0fd954362cf54b22 | [
"MIT"
] | null | null | null | Python/logest_vowel_chain.py | shloch/CODING_PRACTICE | c79ed3c2b576d133fd7a446b0fd954362cf54b22 | [
"MIT"
] | 1 | 2022-03-12T06:43:31.000Z | 2022-03-12T06:43:31.000Z | # The vowel substrings in the word codewarriors are o,e,a,io.
# The longest of these has a length of 2. Given a lowercase string that has
# alphabetic characters only (both vowels and consonants) and no spaces,
# return the length of the longest vowel substring. Vowels are any of aeiou.
# Good luck!
# If you lik... | 32.190476 | 82 | 0.657544 | # The vowel substrings in the word codewarriors are o,e,a,io.
# The longest of these has a length of 2. Given a lowercase string that has
# alphabetic characters only (both vowels and consonants) and no spaces,
# return the length of the longest vowel substring. Vowels are any of aeiou.
# Good luck!
# If you lik... | 0 | 0 | 0 | 0 | 0 | 472 | 0 | 0 | 23 |
b9311dc9b6d2c8e5ef3d1eeaad37476bb0b3a3a9 | 18,356 | py | Python | numpy/linalg/_umath_linalg.py | Squarecap/numpy | 1172b039950db72ae8452e9f65b5fd7cac977a23 | [
"BSD-3-Clause"
] | 195 | 2016-01-14T16:03:02.000Z | 2021-12-29T09:15:02.000Z | numpy/linalg/_umath_linalg.py | Squarecap/numpy | 1172b039950db72ae8452e9f65b5fd7cac977a23 | [
"BSD-3-Clause"
] | 75 | 2016-01-14T16:03:02.000Z | 2020-04-29T22:51:53.000Z | numpy/linalg/_umath_linalg.py | Squarecap/numpy | 1172b039950db72ae8452e9f65b5fd7cac977a23 | [
"BSD-3-Clause"
] | 11 | 2016-01-15T17:30:16.000Z | 2020-07-30T03:58:42.000Z | # calls the functions from linalg/umath_linalg.c.src via cffi rather than cpyext
# As opposed to the numpy version, this version leaves broadcasting to the responsibility
# of the pypy extended frompyfunc, so the _umath_linag_capi functions are always called
# with the final arguments, no broadcasting needed.
from ._u... | 44.338164 | 99 | 0.492537 | # calls the functions from linalg/umath_linalg.c.src via cffi rather than cpyext
# As opposed to the numpy version, this version leaves broadcasting to the responsibility
# of the pypy extended frompyfunc, so the _umath_linag_capi functions are always called
# with the final arguments, no broadcasting needed.
import os... | 0 | 0 | 0 | 8 | 0 | 4,298 | 0 | -10 | 319 |
2f15d94bb5952d1b83877da4038f29d1e7be7afa | 593 | py | Python | abc/abc058/c/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/abc058/c/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/abc058/c/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
from collections import defaultdict
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
N = ni()
S = [ns() for _ in range(N)]
dd = []
for i in range(N):
d = defaultdict(... | 16.472222 | 53 | 0.56661 | import sys
import math
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
N = ni()
S = [ns() for _ in range(N)]
dd = []
for i in range(N):
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
69a4e9305db3f2a172ab65772db16db9a9c33a41 | 258 | py | Python | albumentations/augmentations/utils.py | code-kage/albumentations | f2462be3a4d01c872474d0e7fc0f32f387b06340 | [
"MIT"
] | 6,316 | 2019-11-18T14:19:17.000Z | 2022-03-31T22:25:23.000Z | albumentations/augmentations/utils.py | code-kage/albumentations | f2462be3a4d01c872474d0e7fc0f32f387b06340 | [
"MIT"
] | 558 | 2019-11-19T00:36:01.000Z | 2022-03-30T22:04:15.000Z | albumentations/augmentations/utils.py | code-kage/albumentations | f2462be3a4d01c872474d0e7fc0f32f387b06340 | [
"MIT"
] | 889 | 2019-11-18T16:49:44.000Z | 2022-03-28T11:00:14.000Z |
__all__ = ["read_bgr_image", "read_rgb_image"]
| 19.846154 | 49 | 0.74031 | import cv2
__all__ = ["read_bgr_image", "read_rgb_image"]
def read_bgr_image(path):
return cv2.imread(path, cv2.IMREAD_COLOR)
def read_rgb_image(path):
image = cv2.imread(path, cv2.IMREAD_COLOR)
return cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
| 0 | 0 | 0 | 0 | 0 | 151 | 0 | -11 | 68 |
8f5a8a3f7052b73c3cb7df220d26698296bb1278 | 6,932 | py | Python | tests/test_extractor_api_lmpd.py | isabella232/comport | 117123862415261095a917ed7f2037c1f986b474 | [
"BSD-3-Clause"
] | 35 | 2015-11-14T18:32:45.000Z | 2022-01-23T15:15:05.000Z | tests/test_extractor_api_lmpd.py | codeforamerica/comport | 117123862415261095a917ed7f2037c1f986b474 | [
"BSD-3-Clause"
] | 119 | 2015-11-20T22:45:34.000Z | 2022-02-10T23:02:36.000Z | tests/test_extractor_api_lmpd.py | isabella232/comport | 117123862415261095a917ed7f2037c1f986b474 | [
"BSD-3-Clause"
] | 19 | 2015-11-20T20:41:52.000Z | 2022-01-26T04:12:34.000Z | # -*- coding: utf-8 -*-
| 46.837838 | 109 | 0.680323 | # -*- coding: utf-8 -*-
import pytest
from comport.department.models import Department, Extractor
from comport.data.models import IncidentsUpdated, UseOfForceIncidentLMPD
from testclient.JSON_test_client import JSONTestClient
@pytest.mark.usefixtures('db')
class TestExtractorLMPD:
def test_post_uof_data(self, tes... | 0 | 6,683 | 0 | 0 | 0 | 0 | 0 | 114 | 111 |
de9d8f2f327853de202704385252c5a5a91032c0 | 1,378 | py | Python | via_cms/view/private/user/dashboard_user.py | jeanjacquesp/via-cms | 12b212f8005e3d667c23ffc4da831e4d3e653999 | [
"MIT"
] | null | null | null | via_cms/view/private/user/dashboard_user.py | jeanjacquesp/via-cms | 12b212f8005e3d667c23ffc4da831e4d3e653999 | [
"MIT"
] | null | null | null | via_cms/view/private/user/dashboard_user.py | jeanjacquesp/via-cms | 12b212f8005e3d667c23ffc4da831e4d3e653999 | [
"MIT"
] | null | null | null | """Public section, including homepage and signup."""
# Copyright 2020 Pax Syriana Foundation. Licensed under the Apache License, Version 2.0
#
#
from flask import Blueprint
from via_common.multiprocess.logger_manager import LoggerManager
logger = LoggerManager.get_logger('dashboard_user')
bp = Blueprint('private.u... | 29.319149 | 104 | 0.687954 | """Public section, including homepage and signup."""
# Copyright 2020 Pax Syriana Foundation. Licensed under the Apache License, Version 2.0
#
#
from flask import Blueprint
from flask_login import login_required
from via_common.multiprocess.logger_manager import LoggerManager
from via_cms.util.helper import get_loc... | 0 | 690 | 0 | 0 | 0 | 0 | 0 | 120 | 134 |
2bc2126000e66ea84f8f088f8b42bff3b3f055d0 | 375 | py | Python | lessons/or_statement.py | thepros847/python_programiing | d177f79d0d1f21df434bf3f8663ae6469fcf8357 | [
"MIT"
] | null | null | null | lessons/or_statement.py | thepros847/python_programiing | d177f79d0d1f21df434bf3f8663ae6469fcf8357 | [
"MIT"
] | null | null | null | lessons/or_statement.py | thepros847/python_programiing | d177f79d0d1f21df434bf3f8663ae6469fcf8357 | [
"MIT"
] | null | null | null | won_bet = True
big_win = True
if won_bet or big_win:
print("You can now stop betting!")
won_bet = False
big_win = True
if won_bet or big_win:
print("You can now stop betting!")
won_bet = True
big_win = False
if won_bet or big_win:
print("You can now stop betting!")
won_bet = False
big_win = False
if ... | 16.304348 | 35 | 0.704 | won_bet = True
big_win = True
if won_bet or big_win:
print("You can now stop betting!")
won_bet = False
big_win = True
if won_bet or big_win:
print("You can now stop betting!")
won_bet = True
big_win = False
if won_bet or big_win:
print("You can now stop betting!")
won_bet = False
big_win = False
if ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
57b693e3915dac479d4cc3a37cc08f506c6b13c3 | 1,313 | py | Python | img_classification/models.py | frgfm/torch-hawk | 05338c9939323c466a2f965ee703a74292347ea6 | [
"MIT"
] | 1 | 2019-08-15T15:22:24.000Z | 2019-08-15T15:22:24.000Z | img_classification/models.py | frgfm/TorchHawk | 05338c9939323c466a2f965ee703a74292347ea6 | [
"MIT"
] | null | null | null | img_classification/models.py | frgfm/TorchHawk | 05338c9939323c466a2f965ee703a74292347ea6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
PyTorch implementation of LeNet5
'''
import torch.nn as nn
| 32.825 | 100 | 0.44326 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
PyTorch implementation of LeNet5
'''
import torch.nn as nn
class LeNet5(nn.Module):
def __init__(self, in_channels, activation=None, pooling=None, drop_rate=0):
super(LeNet5, self).__init__()
if activation is None:
activation = nn.R... | 0 | 0 | 0 | 1,178 | 0 | 0 | 0 | 0 | 23 |
fbe0f72b5f6256a250f297ec4812e3182a30e59f | 6,280 | py | Python | pychassisctl/chassis_control.py | ouyangxx10/my-skeleton | e32e33784a1883ee4528b17617df14f3114b0f5e | [
"Apache-2.0"
] | 14 | 2021-11-04T07:47:37.000Z | 2022-03-21T10:10:30.000Z | pychassisctl/chassis_control.py | SayCV/skeleton | 1146f8c6e5f955fb10f5e846de31052be942a7f2 | [
"Apache-2.0"
] | 79 | 2015-10-27T13:27:24.000Z | 2020-05-21T16:10:34.000Z | pychassisctl/chassis_control.py | SayCV/skeleton | 1146f8c6e5f955fb10f5e846de31052be942a7f2 | [
"Apache-2.0"
] | 78 | 2015-08-31T16:22:42.000Z | 2020-07-27T15:18:53.000Z | #!/usr/bin/env python
# TODO: openbmc/openbmc#2994 remove python 2 support
try: # python 2
import gobject
except ImportError: # python 3
from gi.repository import GObject as gobject
import dbus
import dbus.service
import dbus.mainloop.glib
from obmc.dbuslib.bindings import get_dbus
DBUS_NAME = 'org.openbmc.... | 33.763441 | 79 | 0.578822 | #!/usr/bin/env python
# TODO: openbmc/openbmc#2994 remove python 2 support
try: # python 2
import gobject
except ImportError: # python 3
from gi.repository import GObject as gobject
import dbus
import dbus.service
import dbus.mainloop.glib
from obmc.dbuslib.bindings import get_dbus, DbusProperties, DbusObjec... | 0 | 1,906 | 0 | 3,443 | 0 | 0 | 0 | 35 | 23 |
236686b32ff4985770047b48b55d2526ce909c80 | 499 | py | Python | CeV - Gustavo Guanabara/exerc017.py | us19861229c/Meu-aprendizado-Python | 575c0714ac5377ff3122f4cb57952969e07ba89b | [
"Unlicense"
] | 1 | 2021-12-11T19:53:41.000Z | 2021-12-11T19:53:41.000Z | CeV - Gustavo Guanabara/exerc017.py | us19861229c/Meu-aprendizado-Python | 575c0714ac5377ff3122f4cb57952969e07ba89b | [
"Unlicense"
] | null | null | null | CeV - Gustavo Guanabara/exerc017.py | us19861229c/Meu-aprendizado-Python | 575c0714ac5377ff3122f4cb57952969e07ba89b | [
"Unlicense"
] | null | null | null | #Programa que leia o cateto oposto e o adjacente de um triangulo retangulo
#e mostre o comprimento da hipotenusa
cat_o = float(input("comprimento do cateto oposto: "))
cat_a = float(input("comprimento do cateto adjacente: "))
c_hip = (cat_o ** 2 + cat_a ** 2) ** (1/2)
print(f" A hipotenusa mede {c_hip:.2f}")
import... | 29.352941 | 74 | 0.707415 | #Programa que leia o cateto oposto e o adjacente de um triangulo retangulo
#e mostre o comprimento da hipotenusa
cat_o = float(input("comprimento do cateto oposto: "))
cat_a = float(input("comprimento do cateto adjacente: "))
c_hip = (cat_o ** 2 + cat_a ** 2) ** (1/2)
print(f" A hipotenusa mede {c_hip:.2f}")
import... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b85408e261ebdae7d5cae42388deed31f5a58c85 | 6,497 | py | Python | tests/conftest.py | mitsosf/invenio-vocabularies | 5247062cdd1a8e368b357648d53ee65ff37fc1c5 | [
"MIT"
] | null | null | null | tests/conftest.py | mitsosf/invenio-vocabularies | 5247062cdd1a8e368b357648d53ee65ff37fc1c5 | [
"MIT"
] | null | null | null | tests/conftest.py | mitsosf/invenio-vocabularies | 5247062cdd1a8e368b357648d53ee65ff37fc1c5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2021 TU Wien.
#
# Invenio-Vocabularies is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Pytest configuration.
See https://pytest-invenio.readthedocs.io/ for docu... | 28.00431 | 79 | 0.682777 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2021 TU Wien.
#
# Invenio-Vocabularies is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Pytest configuration.
See https://pytest-invenio.readthedocs.io/ for docu... | 0 | 4,346 | 0 | 0 | 0 | 0 | 0 | 349 | 633 |
dbbca9cf19db385008eaaa0a7aa1c520e992234e | 438 | py | Python | casper/cp/int/spexpr/explicit.cpp.py | marcovc/casper | 752ad1c9ecb9408b0a3719a2c8727b87e2d158cf | [
"Apache-2.0"
] | 1 | 2019-06-20T17:04:06.000Z | 2019-06-20T17:04:06.000Z | casper/cp/int/spexpr/explicit.cpp.py | marcovc/casper | 752ad1c9ecb9408b0a3719a2c8727b87e2d158cf | [
"Apache-2.0"
] | null | null | null | casper/cp/int/spexpr/explicit.cpp.py | marcovc/casper | 752ad1c9ecb9408b0a3719a2c8727b87e2d158cf | [
"Apache-2.0"
] | null | null | null |
import os
import sys
libPath = os.path.abspath('casper/cp/spexpr')
sys.path.append(libPath)
import cputil
import util
print "/* THIS FILE WAS AUTOGENERATED FROM explicit.cpp.py */"
print "#include <casper/cp/spexpr/expr.h>"
print "namespace Casper {"
print "namespace Detail {"
util.printViews(False)
util.printPos... | 17.52 | 62 | 0.753425 |
import os
import sys
libPath = os.path.abspath('casper/cp/spexpr')
sys.path.append(libPath)
import cputil
import util
print "/* THIS FILE WAS AUTOGENERATED FROM explicit.cpp.py */"
print "#include <casper/cp/spexpr/expr.h>"
print "namespace Casper {"
print "namespace Detail {"
util.printViews(False)
util.printPos... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
40a3d23468636877cc485ac9e064ee3527a3dcb2 | 2,032 | py | Python | youtube_dl/extractor/lecture2go.py | builder07/ytdl | 2c0a5d50af7ecc7302c813d649ee72dcd457a50a | [
"Unlicense"
] | 5 | 2016-04-25T16:26:07.000Z | 2021-04-28T16:10:29.000Z | youtube_dl/extractor/lecture2go.py | builder07/ytdl | 2c0a5d50af7ecc7302c813d649ee72dcd457a50a | [
"Unlicense"
] | 5 | 2016-04-22T01:33:31.000Z | 2016-08-04T15:33:19.000Z | youtube_dl/extractor/lecture2go.py | builder07/ytdl | 2c0a5d50af7ecc7302c813d649ee72dcd457a50a | [
"Unlicense"
] | 4 | 2016-04-26T15:27:38.000Z | 2018-11-12T21:04:54.000Z | # coding: utf-8
from __future__ import unicode_literals
| 32.253968 | 93 | 0.543307 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
parse_duration,
int_or_none,
)
class Lecture2GoIE(InfoExtractor):
_VALID_URL = r'https?://lecture2go\.uni-hamburg\.de/veranstaltungen/-/v/(?P<id>\d+)'
_TEST = ... | 2 | 0 | 0 | 1,825 | 0 | 0 | 0 | 58 | 91 |
c0398cfe3d8daf23599fadd62330be430a66f740 | 2,075 | py | Python | build/images/assembly/check_size_hermetic_inputs.py | fabio-d/fuchsia-stardock | e57f5d1cf015fe2294fc2a5aea704842294318d2 | [
"BSD-2-Clause"
] | 5 | 2022-01-10T20:22:17.000Z | 2022-01-21T20:14:17.000Z | build/images/assembly/check_size_hermetic_inputs.py | fabio-d/fuchsia-stardock | e57f5d1cf015fe2294fc2a5aea704842294318d2 | [
"BSD-2-Clause"
] | null | null | null | build/images/assembly/check_size_hermetic_inputs.py | fabio-d/fuchsia-stardock | e57f5d1cf015fe2294fc2a5aea704842294318d2 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3.8
# Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
if __name__ == '__main__':
sys.exit(main())
| 33.467742 | 80 | 0.687711 | #!/usr/bin/env python3.8
# Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import json
import os
import sys
from typing import List
from assembly import FileEntry, FilePath, ImageAssemblyConf... | 0 | 0 | 0 | 0 | 0 | 1,577 | 0 | 45 | 203 |
c502a31a32ab3982c2dc34e9c1322c506014163e | 2,322 | py | Python | app.py | zharmedia386/covid19-flask | 560b359b57cfa621577037e7177b1862b9fa1dc5 | [
"MIT"
] | 1 | 2021-10-06T01:36:30.000Z | 2021-10-06T01:36:30.000Z | app.py | zharmedia386/covid19-flask | 560b359b57cfa621577037e7177b1862b9fa1dc5 | [
"MIT"
] | null | null | null | app.py | zharmedia386/covid19-flask | 560b359b57cfa621577037e7177b1862b9fa1dc5 | [
"MIT"
] | null | null | null | from flask import Flask
application = Flask(__name__)
# Route untuk halaman utama
# Route untuk halaman awal
# Route untuk halaman Indonesia
# Route untuk halaman Global
# Route untuk halaman Indonesia Harian
# Route untuk halaman India
# Route untuk halaman Turki
# Route untuk halaman United States
if __name... | 30.552632 | 119 | 0.726529 | from flask import Flask
from flask.templating import render_template
from models import provinsi,ambilTanggal,dunia,indonesia,harian_indo,india,india_global,turki,turki_global,us,us_global
application = Flask(__name__)
# Route untuk halaman utama
@application.route('/')
def index() :
return render_template('index.h... | 0 | 1,612 | 0 | 0 | 0 | 0 | 0 | 121 | 220 |
8eeb3f38a2c878c85669d3cfd90b524764846032 | 2,823 | py | Python | LeetCode-All-Solution/Python3/LC-0118-Pascals-Triangle.py | YuweiYin/Algorithm_YuweiYin | 28648fac59c5a4e3c907978cbd1b3e662ba18fd5 | [
"MIT"
] | null | null | null | LeetCode-All-Solution/Python3/LC-0118-Pascals-Triangle.py | YuweiYin/Algorithm_YuweiYin | 28648fac59c5a4e3c907978cbd1b3e662ba18fd5 | [
"MIT"
] | null | null | null | LeetCode-All-Solution/Python3/LC-0118-Pascals-Triangle.py | YuweiYin/Algorithm_YuweiYin | 28648fac59c5a4e3c907978cbd1b3e662ba18fd5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""=================================================================
@Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3
@File : LC-0118-Pascals-Triangle.py
@Author : [YuweiYin](https://github.com/YuweiYin)
@Date : 2022-02-15
==================================... | 29.40625 | 117 | 0.568898 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""=================================================================
@Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3
@File : LC-0118-Pascals-Triangle.py
@Author : [YuweiYin](https://github.com/YuweiYin)
@Date : 2022-02-15
==================================... | 0 | 0 | 0 | 1,349 | 0 | 478 | 0 | -8 | 90 |
fa4280a0122aba2877b04c33eb2995d2f7fec771 | 1,997 | py | Python | python/test/unit/caty/jsontools/path/JsonPathLexer.py | hidaruma/caty | f71d2ab0a001ea4f7a96a6e02211187ebbf54773 | [
"MIT"
] | null | null | null | python/test/unit/caty/jsontools/path/JsonPathLexer.py | hidaruma/caty | f71d2ab0a001ea4f7a96a6e02211187ebbf54773 | [
"MIT"
] | null | null | null | python/test/unit/caty/jsontools/path/JsonPathLexer.py | hidaruma/caty | f71d2ab0a001ea4f7a96a6e02211187ebbf54773 | [
"MIT"
] | null | null | null | # coding: utf-8
| 38.403846 | 95 | 0.597897 | # coding: utf-8
from caty.testutil import *
from caty.jsontools.path.JsonPathLexer import *
from StringIO import StringIO
def mk_lexer(s):
io = StringIO()
io.write(s)
io.seek(0)
return Lexer(io)
class LexerTest(TestCase):
def test_lex(self):
lexer = mk_lexer('$;')
self.assertEquals... | 0 | 0 | 0 | 1,760 | 0 | 67 | 0 | 40 | 112 |
7397612fd89d36df1f67d4f884bda55b30e7606d | 580 | py | Python | authome/migrations/0009_auto_20210224_1206.py | rockychen-dpaw/authome | caea623ea7f5d16dc0554fcc7cc78c8063788fb8 | [
"Apache-2.0"
] | 2 | 2019-07-02T06:23:54.000Z | 2021-12-14T04:02:40.000Z | authome/migrations/0009_auto_20210224_1206.py | rockychen-dpaw/authome | caea623ea7f5d16dc0554fcc7cc78c8063788fb8 | [
"Apache-2.0"
] | 9 | 2019-02-18T03:19:54.000Z | 2022-03-31T06:10:36.000Z | authome/migrations/0009_auto_20210224_1206.py | rockychen-dpaw/authome | caea623ea7f5d16dc0554fcc7cc78c8063788fb8 | [
"Apache-2.0"
] | 6 | 2019-01-22T08:10:16.000Z | 2022-02-15T02:42:03.000Z | # Generated by Django 3.1.6 on 2021-02-24 04:06
| 25.217391 | 108 | 0.610345 | # Generated by Django 3.1.6 on 2021-02-24 04:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authome', '0008_auto_20210222_0905'),
]
operations = [
migrations.RemoveField(
model_name='customizableuserflow',
na... | 0 | 0 | 0 | 466 | 0 | 0 | 0 | 19 | 46 |
14f481891662f322b791ad0d090dfeb00e9ca36b | 1,134 | py | Python | setup.py | cdusold/DriveLink | b48ff68f7913e33fc17a07e91ad185b1222fdeb8 | [
"MIT"
] | null | null | null | setup.py | cdusold/DriveLink | b48ff68f7913e33fc17a07e91ad185b1222fdeb8 | [
"MIT"
] | 7 | 2017-09-05T01:07:48.000Z | 2020-10-12T16:40:12.000Z | setup.py | cdusold/DriveLink | b48ff68f7913e33fc17a07e91ad185b1222fdeb8 | [
"MIT"
] | null | null | null | from setuptools import setup
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
setup(
name="DriveLink",
version=read("VERSION").strip(... | 31.5 | 79 | 0.650794 | import os
from setuptools import setup
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.... | 0 | 0 | 0 | 0 | 0 | 66 | 0 | -12 | 45 |
24d8c56bcaf9a4486fd4d84534293fc0807c725f | 1,006 | py | Python | others/differentiation_integration/adaptive_diff.py | bt3gl/Resources-Numerical_Methods_for_Physics | 8668215f107230fafd9bdeb0061d353328cf03e8 | [
"Apache-2.0"
] | 17 | 2019-10-28T03:13:07.000Z | 2020-11-21T17:38:06.000Z | others/differentiation_integration/adaptive_diff.py | bt3gl/Resources-Numerical_Methods_for_Physics | 8668215f107230fafd9bdeb0061d353328cf03e8 | [
"Apache-2.0"
] | null | null | null | others/differentiation_integration/adaptive_diff.py | bt3gl/Resources-Numerical_Methods_for_Physics | 8668215f107230fafd9bdeb0061d353328cf03e8 | [
"Apache-2.0"
] | 5 | 2020-05-09T07:55:32.000Z | 2020-12-12T11:05:42.000Z | # example of error estimation with numerical derivatives and using
# Richardson extrapolation to reduce the leading order error.
import math
# function we are differentiating
# analytic derivative (for comparison)
# difference equation
# desired tolerance -- be careful not to go too close to machine
# epsilon,... | 17.344828 | 67 | 0.653082 | # example of error estimation with numerical derivatives and using
# Richardson extrapolation to reduce the leading order error.
import math
# function we are differentiating
def fun(x):
return math.sin(x)
# analytic derivative (for comparison)
def fprime(x):
return math.cos(x)
# difference equation
def ... | 0 | 0 | 0 | 0 | 0 | 67 | 0 | 0 | 66 |
607de21a293deb30eaae6c2ead95e72724663ad8 | 3,429 | py | Python | architect/commands/__init__.py | dimagi/architect | b87475a2eaf63916ad12666c998c062b675bde1d | [
"Apache-2.0"
] | 352 | 2015-01-16T10:22:25.000Z | 2022-02-25T04:19:13.000Z | architect/commands/__init__.py | dimagi/architect | b87475a2eaf63916ad12666c998c062b675bde1d | [
"Apache-2.0"
] | 76 | 2015-01-19T11:15:32.000Z | 2021-12-09T15:35:47.000Z | architect/commands/__init__.py | dimagi/architect | b87475a2eaf63916ad12666c998c062b675bde1d | [
"Apache-2.0"
] | 72 | 2015-01-19T11:53:40.000Z | 2022-03-14T16:09:00.000Z | """
Provides unified interface for all Architect commands. Each command should live
in a separate module and define an "arguments" variable which should contain the
command's arguments and a "run" function which implements the command's behaviour.
"""
import os
import sys
import pkgutil
import argparse
from .. import... | 35.71875 | 117 | 0.654418 | """
Provides unified interface for all Architect commands. Each command should live
in a separate module and define an "arguments" variable which should contain the
command's arguments and a "run" function which implements the command's behaviour.
"""
import os
import sys
import pkgutil
import argparse
from .. import... | 0 | 0 | 0 | 1,392 | 0 | 0 | 0 | 79 | 23 |
4eed8743f1f3a83647a49f1c486e1ac5fae66a0a | 6,315 | py | Python | cnn.py | LinXueyuanStdio/Histopathologic-Cancer-Detection | ef37674283e7e3a4ac0999192b3b297cd55c1429 | [
"Apache-2.0"
] | null | null | null | cnn.py | LinXueyuanStdio/Histopathologic-Cancer-Detection | ef37674283e7e3a4ac0999192b3b297cd55c1429 | [
"Apache-2.0"
] | null | null | null | cnn.py | LinXueyuanStdio/Histopathologic-Cancer-Detection | ef37674283e7e3a4ac0999192b3b297cd55c1429 | [
"Apache-2.0"
] | null | null | null | # Libraries
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import torchvision.transforms as transforms
from sklearn.model_selection import train_test_split
import pandas as pd
# Parameters for model
# Hyper parameters
num_epochs = 10
num_classes = 2
batch_size = 100
learnin... | 35.677966 | 105 | 0.628187 | # Libraries
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import TensorDataset, DataLoader, Dataset
import torchvision
import torchvision.transforms as transforms
from sklearn.model_selection import train_test_split
import os
import numpy as np
import pandas as pd
i... | 0 | 0 | 0 | 2,096 | 0 | 0 | 0 | 15 | 188 |
0ef9739c8bde36c4d0cea8d757c777e458199d47 | 2,897 | py | Python | homeassistant/components/mobile_app/push_notification.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/mobile_app/push_notification.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/mobile_app/push_notification.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Push notification handling."""
from __future__ import annotations
PUSH_CONFIRM_TIMEOUT = 10 # seconds
| 31.150538 | 87 | 0.637556 | """Push notification handling."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.event import async_call_later
from homeassistant.util.uuid import random_uuid_hex
PUSH_CONFIRM_TIMEOUT = 10 # sec... | 0 | 1,460 | 453 | 635 | 0 | 0 | 0 | 106 | 135 |
3c9056dfb6354e5daafd7bffd768de97d7f13f54 | 11,790 | py | Python | src/fidesops/service/connectors/query_config.py | nathanawmk/fidesops | 1ab840206a78e60673aebd5838ba567095512a58 | [
"Apache-2.0"
] | null | null | null | src/fidesops/service/connectors/query_config.py | nathanawmk/fidesops | 1ab840206a78e60673aebd5838ba567095512a58 | [
"Apache-2.0"
] | null | null | null | src/fidesops/service/connectors/query_config.py | nathanawmk/fidesops | 1ab840206a78e60673aebd5838ba567095512a58 | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Dict, Any, TypeVar, Tuple
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
T = TypeVar("T")
MongoStatement = Tuple[Dict[str, Any], Dict[str, Any]]
"""A mongo query is expressed in the form of 2 dicts, the first of which represents
the query object(s) ... | 38.655738 | 128 | 0.598473 | import logging
import re
from abc import ABC, abstractmethod
from typing import Dict, Any, List, Set, Optional, Generic, TypeVar, Tuple
from sqlalchemy import text
from sqlalchemy.sql.elements import TextClause
from fidesops.graph.config import ROOT_COLLECTION_ADDRESS, CollectionAddress
from fidesops.graph.traversal ... | 0 | 1,312 | 0 | 9,319 | 0 | 0 | 0 | 199 | 247 |
2d5262b7779affc730600aceb16db34bead5231a | 1,212 | py | Python | CH05_Perceptron/Perceptron.py | abulimity/Learn-Machine-Learning | 24455a473fdfa439e2a2871d21ffa66245557d69 | [
"MIT"
] | null | null | null | CH05_Perceptron/Perceptron.py | abulimity/Learn-Machine-Learning | 24455a473fdfa439e2a2871d21ffa66245557d69 | [
"MIT"
] | null | null | null | CH05_Perceptron/Perceptron.py | abulimity/Learn-Machine-Learning | 24455a473fdfa439e2a2871d21ffa66245557d69 | [
"MIT"
] | null | null | null | import logging
if __name__ == '__main__':
logging.getLogger().setLevel(logging.INFO)
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
# logging.info('ddddd')
| 28.857143 | 106 | 0.542079 | import numpy as np
import random
import logging
import pandas as pd
class Perceptron(object):
def __init__(self, eta=0.00001, max_iter=5000):
self.eta = eta
self.max_iter = max_iter
self.w = 0
def fit(self, X, y):
X = np.array(pd.DataFrame(X).to_numpy())
y = np.array(... | 0 | 0 | 0 | 868 | 0 | 0 | 0 | -13 | 89 |
8cef407cc7eb1b7e6aa4149bfbe1385b5213c943 | 8,272 | py | Python | nicrabgrp/radio.py | tenoto/nicrabgrp | e81954526d2db9c9b73fde47df27ae9855f52bcb | [
"MIT"
] | null | null | null | nicrabgrp/radio.py | tenoto/nicrabgrp | e81954526d2db9c9b73fde47df27ae9855f52bcb | [
"MIT"
] | null | null | null | nicrabgrp/radio.py | tenoto/nicrabgrp | e81954526d2db9c9b73fde47df27ae9855f52bcb | [
"MIT"
] | null | null | null | __author__ = 'Teruaki Enoto'
__version__ = '0.02'
__date__ = '2018 November 26'
"""
HISTORY
2018-11-26 transfered from giantradiopulse library
2018-10-09 modified by T.Enoto
2018-10-01 created by T.Enoto
"""
import astropy.io.fits as fits
| 46.734463 | 112 | 0.707084 | __author__ = 'Teruaki Enoto'
__version__ = '0.02'
__date__ = '2018 November 26'
"""
HISTORY
2018-11-26 transfered from giantradiopulse library
2018-10-09 modified by T.Enoto
2018-10-01 created by T.Enoto
"""
import os
import pandas as pd
import astropy.io.fits as fits
class GootTimeInterval(object):
def __in... | 0 | 0 | 0 | 7,502 | 0 | 351 | 0 | -14 | 187 |
c389126a8ae454dd027464ab4275b6e60b857dde | 458 | py | Python | sage/factor_ec.py | attacker0211/ectp | 752e8d2bf70a88df0dfbe05e37312d959090ab64 | [
"MIT"
] | 1 | 2021-04-24T17:34:43.000Z | 2021-04-24T17:34:43.000Z | sage/factor_ec.py | attacker0211/ectp | 752e8d2bf70a88df0dfbe05e37312d959090ab64 | [
"MIT"
] | null | null | null | sage/factor_ec.py | attacker0211/ectp | 752e8d2bf70a88df0dfbe05e37312d959090ab64 | [
"MIT"
] | null | null | null | #!/usr/local/bin/sage -python
n = 199843247
done = 0
for b in range(1, int(sqrt(199843247) + 1)):
E = EllipticCurve(Integers(n),[0,0,0,b,-b])
P = E(1,1)
for d in range(2, 21):
# try:
Q = d*P
print(d,"!P &= (",Q[0],"," ,Q[1],")\\\\")
P = Q
# except:
# ... | 20.818182 | 52 | 0.401747 | #!/usr/local/bin/sage -python
from sage.all import *
n = 199843247
done = 0
for b in range(1, int(sqrt(199843247) + 1)):
E = EllipticCurve(Integers(n),[0,0,0,b,-b])
P = E(1,1)
for d in range(2, 21):
# try:
Q = d*P
print(d,"!P &= (",Q[0],"," ,Q[1],")\\\\")
P = Q
# ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 22 |
3263adca4a1202605a047838d18408c8652af18f | 1,990 | py | Python | hw1scripts/Introduction.py | vedatk67/ADM-HW1 | 21da1ba0c4f08a8d3fb14d40a65476b39761b4f9 | [
"MIT"
] | null | null | null | hw1scripts/Introduction.py | vedatk67/ADM-HW1 | 21da1ba0c4f08a8d3fb14d40a65476b39761b4f9 | [
"MIT"
] | null | null | null | hw1scripts/Introduction.py | vedatk67/ADM-HW1 | 21da1ba0c4f08a8d3fb14d40a65476b39761b4f9 | [
"MIT"
] | null | null | null |
#1 -)SAY "HELLO, WORLD!" WITH PYTHON
a = "Hello, World!"
print(a)
#2 -)PYTHON IF - ELSE
# !/bin/python3
# For all condition writing if or elif
if __name__ == '__main__':
n = int(input().strip())
if n % 2 == 1:
print("Weird")
elif n % 2 == 0 and 2 <= n <= 5:
print("Not Weird")
elif ... | 21.170213 | 98 | 0.582915 |
#1 -)SAY "HELLO, WORLD!" WITH PYTHON
a = "Hello, World!"
print(a)
#2 -)PYTHON IF - ELSE
# !/bin/python3
import math
import os
import random
import re
import sys
# For all condition writing if or elif
if __name__ == '__main__':
n = int(input().strip())
if n % 2 == 1:
print("Weird")
elif n % 2 ... | 0 | 0 | 0 | 0 | 0 | 225 | 0 | -53 | 134 |
8a89f180e5173599b237a1625b6352afd5edd205 | 4,613 | py | Python | spectree/response.py | loonateam/spectree | 71b2d34993e01b36a8de18c2a3d6856d0c9e45c3 | [
"Apache-2.0"
] | null | null | null | spectree/response.py | loonateam/spectree | 71b2d34993e01b36a8de18c2a3d6856d0c9e45c3 | [
"Apache-2.0"
] | 1 | 2021-12-16T00:22:43.000Z | 2021-12-16T00:22:43.000Z | spectree/response.py | loonateam/spectree | 71b2d34993e01b36a8de18c2a3d6856d0c9e45c3 | [
"Apache-2.0"
] | null | null | null |
# according to https://tools.ietf.org/html/rfc2616#section-10
# https://tools.ietf.org/html/rfc7231#section-6.1
# https://developer.mozilla.org/sv-SE/docs/Web/HTTP/Status
DEFAULT_CODE_DESC = {
# Information 1xx
"HTTP_100": "Continue",
"HTTP_101": "Switching Protocols",
# Successful 2xx
"HTTP_200"... | 31.813793 | 83 | 0.598309 | from pydantic import BaseModel
from .models import UnprocessableEntity
from .utils import get_model_key, parse_code
class Response:
"""
response object
:param codes: list of HTTP status code, format('HTTP_[0-9]{3}'), 'HTTP200'
:param code_models: dict of <HTTP status code>: <`pydantic.BaseModel`> or... | 0 | 141 | 0 | 1,975 | 0 | 0 | 0 | 50 | 90 |
0c5df2c6515eaf7e4f5d6d6648879dffa4fd63a1 | 185 | py | Python | factorial.py | vidyadeepa/the-coding-interview | 90171b77b6884176a6c28bdccb5d45bd6929b489 | [
"MIT"
] | null | null | null | factorial.py | vidyadeepa/the-coding-interview | 90171b77b6884176a6c28bdccb5d45bd6929b489 | [
"MIT"
] | null | null | null | factorial.py | vidyadeepa/the-coding-interview | 90171b77b6884176a6c28bdccb5d45bd6929b489 | [
"MIT"
] | null | null | null | n=int(input("number: "))
if n==1:
print n
if n<0:
print("sorry..factorial does not exist")
elif n==0:
print ("the factorial of 0 is 1")
else:
for i in range(1,n):
n=n*i
print n
| 15.416667 | 41 | 0.621622 | n=int(input("number: "))
if n==1:
print n
if n<0:
print("sorry..factorial does not exist")
elif n==0:
print ("the factorial of 0 is 1")
else:
for i in range(1,n):
n=n*i
print n
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aed13c5d1a9ef823395ac59d770e8823c72485c5 | 229 | py | Python | myimports/boo/__init__.py | noirqs/PyImports | 1f356ace2035d82a6e15f78b12fdd30520d4e3f7 | [
"BSD-2-Clause"
] | 118 | 2015-02-20T13:59:09.000Z | 2022-01-28T18:43:52.000Z | myimports/boo/__init__.py | noirqs/PyImports | 1f356ace2035d82a6e15f78b12fdd30520d4e3f7 | [
"BSD-2-Clause"
] | 2 | 2017-09-19T03:55:14.000Z | 2018-05-03T10:37:17.000Z | myimports/boo/__init__.py | noirqs/PyImports | 1f356ace2035d82a6e15f78b12fdd30520d4e3f7 | [
"BSD-2-Clause"
] | 16 | 2016-04-07T14:51:19.000Z | 2022-03-25T05:59:05.000Z | #!/usr/bin/env python
# if the __init__.py is imported directly, import the
# folowing classes
# purposely do not define Bookbag here
#from .kbag import Bookbag | 25.444444 | 53 | 0.781659 | #!/usr/bin/env python
# if the __init__.py is imported directly, import the
# folowing classes
from .ger import Booger
from .geyman import Boogeyman, OogieBoogie
# purposely do not define Bookbag here
#from .kbag import Bookbag | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 44 |
341bcbdc53ab71aff215899d95f6e8ce45f87424 | 3,094 | py | Python | tronx/database/postgres/pmpermit_sql.py | JayPatel1314/Tron | d8f2d799eea344c0d76f0fe758ce385c7ceceea7 | [
"MIT"
] | 4 | 2022-03-07T07:27:04.000Z | 2022-03-29T05:59:57.000Z | tronx/database/postgres/pmpermit_sql.py | JayPatel1314/Tron | d8f2d799eea344c0d76f0fe758ce385c7ceceea7 | [
"MIT"
] | null | null | null | tronx/database/postgres/pmpermit_sql.py | JayPatel1314/Tron | d8f2d799eea344c0d76f0fe758ce385c7ceceea7 | [
"MIT"
] | 3 | 2022-03-05T15:24:51.000Z | 2022-03-14T08:48:05.000Z | import threading
# save user ids in whitelists
# save warn msg ids
# save warn counts
PMTABLE.__table__.create(checkfirst=True)
MSGID.__table__.create(checkfirst=True)
DISAPPROVE.__table__.create(checkfirst=True)
INSERTION_LOCK = threading.RLock()
| 18.526946 | 49 | 0.690045 | import threading
from sqlalchemy import (
Column,
String,
Integer
)
from . import SESSION, BASE
# save user ids in whitelists
class PMTABLE(BASE):
__tablename__ = "approve"
user_id = Column(Integer, primary_key=True)
boolvalue = Column(String)
def __init__(self, user_id, boolvalue):
self.user_id = us... | 0 | 0 | 0 | 2,651 | 0 | 0 | 0 | 40 | 135 |
bc0f61b09a1fc2c25361193422c5d174d70204ce | 1,987 | py | Python | calcul.py | kkh1205/python-practice | 893a748db94fde57d935f6235cea3cb4cfb2c579 | [
"MIT"
] | null | null | null | calcul.py | kkh1205/python-practice | 893a748db94fde57d935f6235cea3cb4cfb2c579 | [
"MIT"
] | null | null | null | calcul.py | kkh1205/python-practice | 893a748db94fde57d935f6235cea3cb4cfb2c579 | [
"MIT"
] | null | null | null | ############ ###########
calcul() | 20.915789 | 93 | 0.532964 | ############ 계산기 만들기 연습 ###########
def calcul():
print('\nyou can insert two number and cal. \n inputable cal : +, -, *, /, //, %\n')
a = input('please input num : ')
cal = str(input('please input cal : '))
b = input('please input num : ')
# validation check cal
if(cal != '+' and cal != '-' and cal != '*... | 24 | 0 | 0 | 0 | 0 | 1,919 | 0 | 0 | 23 |
afae55c45c1dcaccefdbf903dd752696e8b7ddc3 | 243 | py | Python | work_one/work_UDP_server.py | YuHongJun/python-training | 6ffafe6c781f29315cf1bb08ea3cec6020f078cd | [
"MIT"
] | 12 | 2017-10-01T00:20:37.000Z | 2017-10-02T10:42:18.000Z | work_one/work_UDP_server.py | YuHongJun/python-training | 6ffafe6c781f29315cf1bb08ea3cec6020f078cd | [
"MIT"
] | null | null | null | work_one/work_UDP_server.py | YuHongJun/python-training | 6ffafe6c781f29315cf1bb08ea3cec6020f078cd | [
"MIT"
] | null | null | null | import socket
s= socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind(('127.0.0.1',9999))
print('Bind UDP on 9999')
while True:
data,addr=s.recvfrom(1024)
print('Received from %s:%s' %addr)
s.sendto(b'Hello, %s!' % data, addr)
| 22.090909 | 50 | 0.666667 | import socket
s= socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
s.bind(('127.0.0.1',9999))
print('Bind UDP on 9999')
while True:
data,addr=s.recvfrom(1024)
print('Received from %s:%s' %addr)
s.sendto(b'Hello, %s!' % data, addr)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
475fa48b4644120f61099979852d996a6a64a790 | 3,528 | py | Python | chemprop/train/create_fingerprints.py | PNNL-CompBio/chemprop-IR | c2e6e585eac4464a1e61ce3674b856a5ced4f18a | [
"MIT"
] | null | null | null | chemprop/train/create_fingerprints.py | PNNL-CompBio/chemprop-IR | c2e6e585eac4464a1e61ce3674b856a5ced4f18a | [
"MIT"
] | null | null | null | chemprop/train/create_fingerprints.py | PNNL-CompBio/chemprop-IR | c2e6e585eac4464a1e61ce3674b856a5ced4f18a | [
"MIT"
] | null | null | null | from argparse import Namespace
import csv
from typing import List, Optional
import torch
from .predict import predict
from chemprop.data import MoleculeDataset
from chemprop.data.utils import get_data, get_data_from_smiles
from chemprop.utils import load_args, load_checkpoint, load_scalers
def create_fingerprints(ar... | 31.783784 | 158 | 0.674603 | from argparse import Namespace
import csv
from typing import List, Optional
import numpy as np
import torch
from tqdm import tqdm
from .predict import predict
from chemprop.data import MoleculeDataset
from chemprop.data.utils import get_data, get_data_from_smiles
from chemprop.utils import load_args, load_checkpoint,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 45 |
0e4b41cc61a152490885cb7f0acef4e1afb82e4d | 14,215 | py | Python | Ch-7/PPO.py | prakHr/temp | 688d71b7deba5f1fcb56fb335922823b8b4dac38 | [
"MIT"
] | 1 | 2020-07-17T05:29:55.000Z | 2020-07-17T05:29:55.000Z | Ch-7/PPO.py | prakHr/temp | 688d71b7deba5f1fcb56fb335922823b8b4dac38 | [
"MIT"
] | null | null | null | Ch-7/PPO.py | prakHr/temp | 688d71b7deba5f1fcb56fb335922823b8b4dac38 | [
"MIT"
] | 3 | 2020-12-12T14:29:09.000Z | 2021-10-11T00:10:40.000Z | import numpy as np
import tensorflow as tf
import gym
from datetime import datetime
def mlp(x, hidden_layers, output_layer, activation=tf.tanh, last_activation=None):
'''
Multi-layer perceptron
'''
for l in hidden_layers:
x = tf.layers.dense(x, units=l, activation=activation)
return tf.lay... | 40.155367 | 163 | 0.636581 | import numpy as np
import tensorflow as tf
import gym
from datetime import datetime
import time
import roboschool
def mlp(x, hidden_layers, output_layer, activation=tf.tanh, last_activation=None):
'''
Multi-layer perceptron
'''
for l in hidden_layers:
x = tf.layers.dense(x, units=l, activation... | 0 | 0 | 0 | 2,143 | 0 | 0 | 0 | -14 | 90 |
b9c6e205abecdeaf8a3c5a94c7509cbccb932228 | 17,207 | py | Python | idgo_admin/models/layer.py | neogeo-technologies/idgo | 23e028b0d7fb2daf54d7e2954e0cc4d7b9be4210 | [
"Apache-2.0"
] | null | null | null | idgo_admin/models/layer.py | neogeo-technologies/idgo | 23e028b0d7fb2daf54d7e2954e0cc4d7b9be4210 | [
"Apache-2.0"
] | 2 | 2018-09-14T07:12:00.000Z | 2019-11-13T09:32:24.000Z | idgo_admin/models/layer.py | neogeo-technologies/idgo | 23e028b0d7fb2daf54d7e2954e0cc4d7b9be4210 | [
"Apache-2.0"
] | 2 | 2019-03-25T08:27:43.000Z | 2019-10-07T15:25:30.000Z | # Copyright (c) 2017-2021 Neogeo-Technologies.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 34.761616 | 105 | 0.56878 | # Copyright (c) 2017-2021 Neogeo-Technologies.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 96 | 1,661 | 0 | 13,694 | 0 | 258 | 0 | 309 | 536 |
d8442700e3683edee60319cb622436d9de214343 | 235 | py | Python | ai/tensorflow/demos/tf_demo2.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 1 | 2019-11-25T07:23:42.000Z | 2019-11-25T07:23:42.000Z | ai/tensorflow/demos/tf_demo2.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | 13 | 2020-01-07T16:09:47.000Z | 2022-03-02T12:51:44.000Z | ai/tensorflow/demos/tf_demo2.py | bigfoolliu/liu_aistuff | aa661d37c05c257ee293285dd0868fb7e8227628 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
import tensorflow as tf
a = tf.constant(10)
b = tf.constant(20)
# withSession()
with tf.Session() as sess:
ret = sess.run(a + b)
print("ret:", ret)
| 15.666667 | 26 | 0.634043 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
import tensorflow as tf
a = tf.constant(10)
b = tf.constant(20)
# 使用with可以自动关闭Session()
with tf.Session() as sess:
ret = sess.run(a + b)
print("ret:", ret)
| 24 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
71c86ea69c3fcb582af69f1eb2c89bc15f83af14 | 302 | py | Python | mjengo/run.py | bilha-analytics/school | d3491eb3f88386dcef35abe13ff8d494790a607d | [
"MIT"
] | null | null | null | mjengo/run.py | bilha-analytics/school | d3491eb3f88386dcef35abe13ff8d494790a607d | [
"MIT"
] | null | null | null | mjengo/run.py | bilha-analytics/school | d3491eb3f88386dcef35abe13ff8d494790a607d | [
"MIT"
] | 1 | 2021-04-08T07:12:48.000Z | 2021-04-08T07:12:48.000Z | import app_pkg_name>
from < import app_pkg_name>.bin, zlogger
app = <app_pkg_name>.init_app()
zlogger.startLogger("<app_pkg_name>")
if __name__ == "__main__":
'''
TODO: populate dummy data, setup zlogger
'''
zlogger.log( "run.py" f"starting {__name__}" )
app.run(debug=True) | 21.571429 | 51 | 0.665563 | import <app_pkg_name>
from <app_pkg_name>.bin import zlogger
app = <app_pkg_name>.init_app()
zlogger.startLogger("<app_pkg_name>")
if __name__ == "__main__":
'''
TODO: populate dummy data, setup zlogger
'''
zlogger.log( "run.py" f"starting {__name__}" )
app.run(debug=True) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 0 |
7c46924325ac62ac5f7485f322519108d5b8fda9 | 1,150 | py | Python | setup.py | anielsen001/pycwt | 0136e5c43519e6973f43f288f76541e34a7ddfe8 | [
"BSD-3-Clause"
] | 185 | 2015-01-04T09:20:37.000Z | 2022-02-28T16:40:07.000Z | setup.py | anielsen001/pycwt | 0136e5c43519e6973f43f288f76541e34a7ddfe8 | [
"BSD-3-Clause"
] | 33 | 2015-08-07T08:02:43.000Z | 2022-01-25T09:12:22.000Z | setup.py | anielsen001/pycwt | 0136e5c43519e6973f43f288f76541e34a7ddfe8 | [
"BSD-3-Clause"
] | 81 | 2015-06-19T15:26:00.000Z | 2022-03-04T09:40:10.000Z | from setuptools import setup
AUTHORS = ('Sebastian Krieger, Nabil Freij, Alexey Brazhe, '
'Christopher Torrence, Gilbert P. Compo and contributors')
setup(
name='pycwt',
version='0.3.0a22',
author=AUTHORS,
author_email='sebastian@nublia.com',
description=('Continuous wavelet transform... | 31.944444 | 71 | 0.634783 | import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
AUTHORS = ('Sebastian Krieger, Nabil Freij, Alexey Brazhe, '
'Christopher Torrence, Gilbert P. Compo and contributors')
setup(
name='pycwt',
version='0.3.0a22',
auth... | 0 | 0 | 0 | 0 | 0 | 66 | 0 | -12 | 45 |
5da4ce214702b4055cf349b708dfa82e2ed0abca | 678 | py | Python | train.py | DOROTHEA0/ConvNeXt | e5f4b4fae5ab36d7e62b6fbfe0cb221b6039d1b1 | [
"MIT"
] | null | null | null | train.py | DOROTHEA0/ConvNeXt | e5f4b4fae5ab36d7e62b6fbfe0cb221b6039d1b1 | [
"MIT"
] | null | null | null | train.py | DOROTHEA0/ConvNeXt | e5f4b4fae5ab36d7e62b6fbfe0cb221b6039d1b1 | [
"MIT"
] | null | null | null | import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--epochs", type=int, default=100, help="number of epochs of training")
parser.add_argument("--batch_size", type=int, default=16, help="number of batch of each epoch")
parser.add_argument("--num_class... | 27.12 | 99 | 0.715339 | import torch
from models.convnext import *
from utils import get_params_groups, create_lr_scheduler
import argparse
def train(opt):
model = convnext_tiny(num_classes=2)
p = get_params_groups(model)
optimizer = torch.optim.AdamW(p, lr=opt.lr)
# lr_scheduler =
if __name__ == '__main__':
parser... | 0 | 0 | 0 | 0 | 0 | 138 | 0 | 34 | 89 |
189b013efcd77df638af98d1d0af87b2d565f03e | 880 | py | Python | Curso-em-video/Aula_104.py | JhonAI13/Curso_python | 27dedb0effa2c26140f46392e993b8e7a27d6eb3 | [
"MIT"
] | null | null | null | Curso-em-video/Aula_104.py | JhonAI13/Curso_python | 27dedb0effa2c26140f46392e993b8e7a27d6eb3 | [
"MIT"
] | null | null | null | Curso-em-video/Aula_104.py | JhonAI13/Curso_python | 27dedb0effa2c26140f46392e993b8e7a27d6eb3 | [
"MIT"
] | null | null | null | # """ 104: Crie um programa que tenha a funo leiaInt(), que vai funcionar de forma
# semelhante 'a funo input() do Python, s que fazendo a validao para aceitar apenas um valor numrico.
# Ex: n = leiaInt('Digite um n: ')"""
#
#
# def leia_int(num):
# n = str(input(num))
# while True:
# if not n.isnumeric... | 26.666667 | 107 | 0.576136 | # """ 104: Crie um programa que tenha a função leiaInt(), que vai funcionar de forma
# semelhante 'a função input() do Python, só que fazendo a validação para aceitar apenas um valor numérico.
# Ex: n = leiaInt('Digite um n: ')"""
#
#
# def leia_int(num):
# n = str(input(num))
# while True:
# if not n.i... | 24 | 0 | 0 | 0 | 0 | 215 | 0 | 0 | 23 |
a4f2eb67e8e54325f2a702921007de9ede24afc9 | 7,195 | py | Python | servicecatalog_puppet/constants_unit_test.py | awslabs/aws-service-catalog-puppet | f8cbf078ad8b31bf191e32ee4f6038c25b721286 | [
"Apache-2.0"
] | 66 | 2019-04-23T12:10:27.000Z | 2022-03-31T19:47:09.000Z | servicecatalog_puppet/constants_unit_test.py | awslabs/aws-service-catalog-puppet | f8cbf078ad8b31bf191e32ee4f6038c25b721286 | [
"Apache-2.0"
] | 283 | 2019-04-18T22:21:20.000Z | 2022-03-31T10:04:42.000Z | servicecatalog_puppet/constants_unit_test.py | awslabs/aws-service-catalog-puppet | f8cbf078ad8b31bf191e32ee4f6038c25b721286 | [
"Apache-2.0"
] | 47 | 2019-05-14T12:45:57.000Z | 2022-03-25T17:54:22.000Z | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
| 45.251572 | 101 | 0.74524 | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
def test_constants_values():
# setup
from servicecatalog_puppet import constants
# exercise
# verify
assert constants.PREFIX == "SC-P--"
assert constants.BOOTSTRAP_STACK_NAME == "... | 0 | 0 | 0 | 0 | 0 | 7,057 | 0 | 0 | 23 |
bee68e3df294d406e351d2aff08551938b188b68 | 21,635 | py | Python | src/vardb/deposit/deposit_analysis.py | Dabble-of-DevOps-Bio/ella | e38631d302611a143c9baaa684bcbd014d9734e4 | [
"MIT"
] | null | null | null | src/vardb/deposit/deposit_analysis.py | Dabble-of-DevOps-Bio/ella | e38631d302611a143c9baaa684bcbd014d9734e4 | [
"MIT"
] | null | null | null | src/vardb/deposit/deposit_analysis.py | Dabble-of-DevOps-Bio/ella | e38631d302611a143c9baaa684bcbd014d9734e4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Code for loading the contents of VCF files into the vardb database.
Use one transaction for whole file, and prompts user before committing.
Adds annotation if supplied annotation is different than what is already in db.
Can use specific annotation parsers to split e.g. allele specific annotat... | 39.264973 | 120 | 0.557985 | #!/usr/bin/env python
"""
Code for loading the contents of VCF files into the vardb database.
Use one transaction for whole file, and prompts user before committing.
Adds annotation if supplied annotation is different than what is already in db.
Can use specific annotation parsers to split e.g. allele specific annotat... | 0 | 175 | 0 | 20,542 | 0 | 0 | 0 | 122 | 227 |
21a0fb13c441aab710ff43e476dfe91fdd0dbf35 | 2,736 | py | Python | gui/feature_tool_delete.py | mdvandamme/PoussePousseEditData | 1864cd7ddad7002c050c2296b2d90ea817e12f57 | [
"MIT"
] | null | null | null | gui/feature_tool_delete.py | mdvandamme/PoussePousseEditData | 1864cd7ddad7002c050c2296b2d90ea817e12f57 | [
"MIT"
] | null | null | null | gui/feature_tool_delete.py | mdvandamme/PoussePousseEditData | 1864cd7ddad7002c050c2296b2d90ea817e12f57 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Delete point. Synchonize with layer and file
-------------------
begin : 2018-07-11
git sha : $Format:%H$
author : M... | 29.73913 | 78 | 0.467471 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Delete point. Synchonize with layer and file
-------------------
begin : 2018-07-11
git sha : $Format:%H$
author : M... | 2 | 0 | 0 | 2,089 | 0 | 0 | 0 | 2 | 223 |
2f216323cd83ace785f153d8023969597da0dfc9 | 17 | py | Python | website/list/__init__.py | webcpp/pyexample | c56d307520899501f7e94261b54d2707a5a6e25d | [
"MIT"
] | 377 | 2017-06-13T23:46:08.000Z | 2022-03-25T01:03:39.000Z | website/list/__init__.py | webcpp/pyexample | c56d307520899501f7e94261b54d2707a5a6e25d | [
"MIT"
] | 16 | 2017-06-18T11:11:56.000Z | 2021-01-06T02:06:12.000Z | website/list/__init__.py | webcpp/pyexample | c56d307520899501f7e94261b54d2707a5a6e25d | [
"MIT"
] | 75 | 2017-06-14T01:07:00.000Z | 2021-12-31T05:27:46.000Z | __all__=['index'] | 17 | 17 | 0.705882 | __all__=['index'] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
08ae64ebaa1e29c0cdbcf44d39700a32bf2d5aa9 | 13,428 | py | Python | biserici_inlemnite/biserici/migrations/0002_auto_20210729_1649.py | ck-tm/biserici-inlemnite | c9d12127b92f25d3ab2fcc7b4c386419fe308a4e | [
"MIT"
] | null | null | null | biserici_inlemnite/biserici/migrations/0002_auto_20210729_1649.py | ck-tm/biserici-inlemnite | c9d12127b92f25d3ab2fcc7b4c386419fe308a4e | [
"MIT"
] | null | null | null | biserici_inlemnite/biserici/migrations/0002_auto_20210729_1649.py | ck-tm/biserici-inlemnite | c9d12127b92f25d3ab2fcc7b4c386419fe308a4e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.13 on 2021-07-29 13:49
| 51.646154 | 188 | 0.651996 | # Generated by Django 3.1.13 on 2021-07-29 13:49
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('bis... | 0 | 0 | 0 | 13,247 | 0 | 0 | 0 | 41 | 90 |
165c0a2714c4d1044b6a5ff9ba17edf6cc5fe708 | 433 | py | Python | test/programytest/storage/entities/test_braintree.py | cdoebler1/AIML2 | ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a | [
"MIT"
] | 345 | 2016-11-23T22:37:04.000Z | 2022-03-30T20:44:44.000Z | test/programytest/storage/entities/test_braintree.py | MikeyBeez/program-y | 00d7a0c7d50062f18f0ab6f4a041068e119ef7f0 | [
"MIT"
] | 275 | 2016-12-07T10:30:28.000Z | 2022-02-08T21:28:33.000Z | test/programytest/storage/entities/test_braintree.py | VProgramMist/modified-program-y | f32efcafafd773683b3fe30054d5485fe9002b7d | [
"MIT"
] | 159 | 2016-11-28T18:59:30.000Z | 2022-03-20T18:02:44.000Z | import unittest
| 30.928571 | 63 | 0.732102 | import unittest
import unittest.mock
from programy.storage.entities.braintree import BraintreeStore
class BraintreeStoreTests(unittest.TestCase):
def test_save_braintree(self):
store = BraintreeStore()
with self.assertRaises(NotImplementedError):
client_context = unittest.mock.Mock()... | 0 | 0 | 0 | 309 | 0 | 0 | 0 | 40 | 68 |
6653615b19835c8b23801549af20302977e61fa4 | 7,750 | py | Python | project/lit_gat.py | amorehead/Equivariant-GNNs | 4e81136242a4c8905b0e5fc39be5f704a42cc5e1 | [
"Apache-2.0"
] | 2 | 2021-10-07T12:53:51.000Z | 2022-01-04T19:26:08.000Z | project/lit_gat.py | amorehead/Equivariant-GNNs | 4e81136242a4c8905b0e5fc39be5f704a42cc5e1 | [
"Apache-2.0"
] | null | null | null | project/lit_gat.py | amorehead/Equivariant-GNNs | 4e81136242a4c8905b0e5fc39be5f704a42cc5e1 | [
"Apache-2.0"
] | null | null | null |
if __name__ == '__main__':
cli_main()
| 34.753363 | 118 | 0.638452 | import os
import pytorch_lightning as pl
from dgl.nn.pytorch import GATConv
from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping, LearningRateMonitor
from torch.nn import BCEWithLogitsLoss, ModuleList
from torch.nn.functional import elu
from torch.optim import Adam
from torchmetrics import F1
from p... | 0 | 0 | 0 | 4,969 | 0 | 2,219 | 0 | 248 | 268 |
66272a0a136759af8b432234302a33adf2071b04 | 2,776 | py | Python | lib/request.py | jtowers/dxmate | ffaedb295996c1b4ac8fab4c707944a9c42afd04 | [
"MIT"
] | 1 | 2017-08-30T18:11:45.000Z | 2017-08-30T18:11:45.000Z | lib/request.py | jtowers/dxmate | ffaedb295996c1b4ac8fab4c707944a9c42afd04 | [
"MIT"
] | null | null | null | lib/request.py | jtowers/dxmate | ffaedb295996c1b4ac8fab4c707944a9c42afd04 | [
"MIT"
] | null | null | null | #MIT License
#
#Copyright (c) 2017 Tom van Ommeren
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, pu... | 32.658824 | 79 | 0.701369 | #MIT License
#
#Copyright (c) 2017 Tom van Ommeren
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, pu... | 0 | 889 | 0 | 718 | 0 | 0 | 0 | 12 | 67 |
1cc74c0b296a410aa72393543d7d7a0a6d5c05d3 | 2,677 | py | Python | celery_queue/tests/permits_data_generator.py | olmax99/pyathenastack | de2a646bf99be9d5c45bf771f73a6f0ef81c6227 | [
"Unlicense"
] | 2 | 2019-10-17T14:48:50.000Z | 2019-10-20T12:24:41.000Z | celery_queue/tests/permits_data_generator.py | olmax99/dockerflaskapi | de2a646bf99be9d5c45bf771f73a6f0ef81c6227 | [
"Unlicense"
] | 1 | 2021-06-02T00:20:51.000Z | 2021-06-02T00:20:51.000Z | celery_queue/tests/permits_data_generator.py | olmax99/pyathenastack | de2a646bf99be9d5c45bf771f73a6f0ef81c6227 | [
"Unlicense"
] | null | null | null | import time
from datetime import timedelta
from random import randrange
def random_time_range(start, end, file_format, prop):
"""Get a time at a proportion of a range of two formatted times.
start and end should be strings specifying times formated in the
given format (strftime-style), giving an interva... | 36.671233 | 149 | 0.632798 | import json
import string
import time
import pandas as pd
from datetime import timedelta, datetime
from random import randint, uniform, choice, randrange, choices
def random_time_range(start, end, file_format, prop):
"""Get a time at a proportion of a range of two formatted times.
start and end should be st... | 0 | 0 | 0 | 0 | 0 | 1,388 | 0 | 25 | 112 |
f2c7ced1309974aa41278df072ebf59305bb8d14 | 1,238 | py | Python | investmentGame/User.py | tobiaskamphuis/Investment-game | 7042f0527ea5e046f6ffbe73097996e94c8bb559 | [
"MIT"
] | null | null | null | investmentGame/User.py | tobiaskamphuis/Investment-game | 7042f0527ea5e046f6ffbe73097996e94c8bb559 | [
"MIT"
] | 1 | 2021-06-02T00:46:12.000Z | 2021-06-02T00:46:12.000Z | investmentGame/User.py | tobiaskamphuis/Investment-game | 7042f0527ea5e046f6ffbe73097996e94c8bb559 | [
"MIT"
] | null | null | null | #from investmentGame.Portfolio import Portfolio
#User(name='Jeroen', age=26, balance=20)#, password='Welcome'
#u.transaction('buy', 'market_order', 20, 1) | 36.411765 | 104 | 0.727787 | from investmentGame.Order import Order
#from investmentGame.Portfolio import Portfolio
from sqlalchemy import Column, Integer, String, Boolean
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from investmentGame.db import Base
class User(Base):
__tablename__ = "users"... | 0 | 0 | 0 | 831 | 0 | 0 | 0 | 116 | 133 |
5e9710be8a6532e1f5e1f35a5c81a287842bb736 | 949 | py | Python | .hooks/jira_id/jira_id_check.py | mikbhub/pre-commit-pipeline | cf80bcfdc3cdd378a7473fac45890b38a88bbaa0 | [
"Apache-2.0"
] | null | null | null | .hooks/jira_id/jira_id_check.py | mikbhub/pre-commit-pipeline | cf80bcfdc3cdd378a7473fac45890b38a88bbaa0 | [
"Apache-2.0"
] | null | null | null | .hooks/jira_id/jira_id_check.py | mikbhub/pre-commit-pipeline | cf80bcfdc3cdd378a7473fac45890b38a88bbaa0 | [
"Apache-2.0"
] | null | null | null | import re
import sys
JIRA_ID_REGEX = re.compile(r"[A-Z]+-\d+")
MISSING_JIRA_ID_MSG = """
Commit message is missing [JIRA task id].
Include [JIRA task id] in commit message, like so:
#################################
ABC-123 this is my commit message
#################################
where ABC-123 is a sample [JIRA t... | 26.361111 | 97 | 0.679663 | import re
import sys
JIRA_ID_REGEX = re.compile(r"[A-Z]+-\d+")
MISSING_JIRA_ID_MSG = """
Commit message is missing [JIRA task id].
Include [JIRA task id] in commit message, like so:
#################################
ABC-123 this is my commit message
#################################
where ABC-123 is a sample [JIRA t... | 0 | 0 | 0 | 0 | 0 | 83 | 0 | 0 | 23 |
1750cfbf173ab7f2a53b410c1505978c8aa64cbf | 809 | py | Python | invenio_records_lom/services/permissions.py | tu-graz-library/invenio-records-lom | c811506e51a1ed15d11cf10d6e6ef83a4ecc202b | [
"MIT"
] | null | null | null | invenio_records_lom/services/permissions.py | tu-graz-library/invenio-records-lom | c811506e51a1ed15d11cf10d6e6ef83a4ecc202b | [
"MIT"
] | 18 | 2020-10-21T07:58:14.000Z | 2022-03-29T12:10:25.000Z | invenio_records_lom/services/permissions.py | tu-graz-library/invenio-records-lom | c811506e51a1ed15d11cf10d6e6ef83a4ecc202b | [
"MIT"
] | 7 | 2020-10-06T08:46:40.000Z | 2021-07-06T13:21:29.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Graz University of Technology.
#
# invenio-records-lom is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Permission-config classes for LOMRecordService-objects."""
| 33.708333 | 83 | 0.763906 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Graz University of Technology.
#
# invenio-records-lom is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Permission-config classes for LOMRecordService-objects."""
from invenio_records_p... | 0 | 0 | 0 | 348 | 0 | 0 | 0 | 95 | 68 |