hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7473c8a9fa54b5f004f7948458934372837e46b | 4,040 | py | Python | examples/test_mocsy.py | tomaslovato/mocsy | ede19cde4be5cd37ed192a3f3394e81302d11616 | [
"MIT"
] | null | null | null | examples/test_mocsy.py | tomaslovato/mocsy | ede19cde4be5cd37ed192a3f3394e81302d11616 | [
"MIT"
] | null | null | null | examples/test_mocsy.py | tomaslovato/mocsy | ede19cde4be5cd37ed192a3f3394e81302d11616 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import numpy as np
sys.path.append("../")
import mocsy
# Define input data (typical values at depth from 0 to 5000 meters)
temp = np.repeat(2.0, 6).astype('float32')
depth = np.arange (0, 6000, 1000).astype('float32')
sal = np.repeat(35.0, 6).astype('float32')
alk = np.repeat(2295.*1... | 45.393258 | 217 | 0.603465 |
import sys
import numpy as np
sys.path.append("../")
import mocsy
temp = np.repeat(2.0, 6).astype('float32')
depth = np.arange (0, 6000, 1000).astype('float32')
sal = np.repeat(35.0, 6).astype('float32')
alk = np.repeat(2295.*1.e-6, 6).astype('float32')
dic = np.repeat(2154.*1.e-6, 6).astype('float32')
sil = phos = ... | true | true |
f7473d2b7e3f2cef9221158655b9635665d65edd | 13,306 | py | Python | TX/test/invoke_transction.py | trinity-project/trinity | 081eba1d4294a3bed33ba18c3f7b862b8803ee22 | [
"MIT"
] | 60 | 2018-01-12T07:33:15.000Z | 2021-12-28T23:06:28.000Z | TX/test/invoke_transction.py | trinity-project/trinity | 081eba1d4294a3bed33ba18c3f7b862b8803ee22 | [
"MIT"
] | 13 | 2018-01-23T00:14:35.000Z | 2020-04-23T00:03:31.000Z | TX/test/invoke_transction.py | trinity-project/trinity | 081eba1d4294a3bed33ba18c3f7b862b8803ee22 | [
"MIT"
] | 13 | 2018-01-05T07:27:29.000Z | 2021-01-06T16:45:05.000Z | import binascii
import pprint
import time
from neocore.BigInteger import BigInteger
from neocore.Cryptography.Crypto import Crypto
from TX.MyTransaction import InvocationTransaction
from TX.TransactionAttribute import TransactionAttribute, TransactionAttributeUsage
from TX.config import *
# from TX.interface import cre... | 102.353846 | 2,757 | 0.885014 | import binascii
import pprint
import time
from neocore.BigInteger import BigInteger
from neocore.Cryptography.Crypto import Crypto
from TX.MyTransaction import InvocationTransaction
from TX.TransactionAttribute import TransactionAttribute, TransactionAttributeUsage
from TX.config import *
from TX.interface import cre... | true | true |
f7473ed88b053755c72c2313785966efbee32ec9 | 1,347 | py | Python | SE4TeC_demo/utils/timeseries.py | JingweiZuo/SE2TeC | f2aab845aa648e366d0f6917a5d8abfd4d556d13 | [
"Apache-2.0"
] | 1 | 2020-05-10T11:23:11.000Z | 2020-05-10T11:23:11.000Z | SE4TeC_demo/utils/timeseries.py | JingweiZuo/SE4TeC | f2aab845aa648e366d0f6917a5d8abfd4d556d13 | [
"Apache-2.0"
] | null | null | null | SE4TeC_demo/utils/timeseries.py | JingweiZuo/SE4TeC | f2aab845aa648e366d0f6917a5d8abfd4d556d13 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from collections import defaultdict
import sys
from typing import Any
class TimeSeries(object):
def __init__(self):
self.class_timeseries = ''
self.dimension_name = ''
self.discmP = {}
self.threshP = {}
self.timeseries = None
self.matched = False
... | 31.325581 | 76 | 0.616927 | import numpy as np
from collections import defaultdict
import sys
from typing import Any
class TimeSeries(object):
def __init__(self):
self.class_timeseries = ''
self.dimension_name = ''
self.discmP = {}
self.threshP = {}
self.timeseries = None
self.matched = False
... | true | true |
f7473efbcb48dc795ca5e0d7fc30095e44a5f4cd | 3,466 | py | Python | bindings/python/ensmallen/datasets/string/bacilluslitoralis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/bacilluslitoralis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/bacilluslitoralis.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Bacillus litoralis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein ass... | 33.009524 | 223 | 0.677149 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def BacillusLitoralis(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/string"... | true | true |
f7473f06895a418f06a11e200d89fe5fc186b65d | 1,773 | py | Python | Solution/Maps.Data.OpenStreetMap/Scripts/CreateRelationsGeomTableBboxes.py | cmberryau/maps | 470ddc077b0aed71d83466320d1ab0a5dd235e38 | [
"MIT"
] | 1 | 2021-08-19T07:16:22.000Z | 2021-08-19T07:16:22.000Z | Solution/Maps.Data.OpenStreetMap/Scripts/CreateRelationsGeomTableBboxes.py | cmberryau/maps | 470ddc077b0aed71d83466320d1ab0a5dd235e38 | [
"MIT"
] | null | null | null | Solution/Maps.Data.OpenStreetMap/Scripts/CreateRelationsGeomTableBboxes.py | cmberryau/maps | 470ddc077b0aed71d83466320d1ab0a5dd235e38 | [
"MIT"
] | 1 | 2021-08-19T07:16:24.000Z | 2021-08-19T07:16:24.000Z | import psycopg2
import argparse
import getpass
# define arguments
parser = argparse.ArgumentParser(description='Creates bounding boxes for OSM relations')
parser.add_argument('hostname', help='PostgreSQL hostname')
parser.add_argument('db', help='PostgreSQL database name')
parser.add_argument('username', help='Postgre... | 34.096154 | 169 | 0.63057 | import psycopg2
import argparse
import getpass
parser = argparse.ArgumentParser(description='Creates bounding boxes for OSM relations')
parser.add_argument('hostname', help='PostgreSQL hostname')
parser.add_argument('db', help='PostgreSQL database name')
parser.add_argument('username', help='PostgreSQL username')
a... | true | true |
f7473f10bb4f9fc15e282b1389b1f0f964732dc3 | 1,555 | py | Python | python/plotserv/__init__.py | advancedplotting/aplot | f00d6bdde8d2fa0736b2daf69ee81baba0b0e06f | [
"BSD-3-Clause"
] | 10 | 2016-01-06T09:35:59.000Z | 2021-09-14T18:24:14.000Z | python/plotserv/__init__.py | advancedplotting/aplot | f00d6bdde8d2fa0736b2daf69ee81baba0b0e06f | [
"BSD-3-Clause"
] | null | null | null | python/plotserv/__init__.py | advancedplotting/aplot | f00d6bdde8d2fa0736b2daf69ee81baba0b0e06f | [
"BSD-3-Clause"
] | 9 | 2015-09-01T18:33:55.000Z | 2022-03-09T21:53:02.000Z | # Copyright (c) 2014-2015, Heliosphere Research LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of c... | 55.535714 | 77 | 0.789068 | true | true | |
f7473f4fb847e44106df41ef5db87004cef977f9 | 1,410 | py | Python | catalog/tests/test_forms.py | lair60/django_local_library | 2b8798abec318a3c28b77acae7d9ab7f7f44e016 | [
"MIT"
] | null | null | null | catalog/tests/test_forms.py | lair60/django_local_library | 2b8798abec318a3c28b77acae7d9ab7f7f44e016 | [
"MIT"
] | null | null | null | catalog/tests/test_forms.py | lair60/django_local_library | 2b8798abec318a3c28b77acae7d9ab7f7f44e016 | [
"MIT"
] | null | null | null | import datetime
from django.test import TestCase
from django.utils import timezone
from catalog.forms import RenewBookForm
class RenewBookFormTest(TestCase):
def test_renew_form_date_field_label(self):
form = RenewBookForm()
self.assertTrue(form.fields['renewal_date'].label == None or form.fields... | 40.285714 | 121 | 0.703546 | import datetime
from django.test import TestCase
from django.utils import timezone
from catalog.forms import RenewBookForm
class RenewBookFormTest(TestCase):
def test_renew_form_date_field_label(self):
form = RenewBookForm()
self.assertTrue(form.fields['renewal_date'].label == None or form.fields... | true | true |
f7473f9bcbbdfe4db020b9ee33054523c21445ea | 53,231 | py | Python | tests/parser/features/external_contracts/test_external_contract_calls.py | hitsuzen-eth/vyper | d1073241465d360c478d736f7740b1e1afac2c01 | [
"Apache-2.0"
] | 1 | 2022-03-29T16:39:04.000Z | 2022-03-29T16:39:04.000Z | tests/parser/features/external_contracts/test_external_contract_calls.py | hitsuzen-eth/vyper | d1073241465d360c478d736f7740b1e1afac2c01 | [
"Apache-2.0"
] | null | null | null | tests/parser/features/external_contracts/test_external_contract_calls.py | hitsuzen-eth/vyper | d1073241465d360c478d736f7740b1e1afac2c01 | [
"Apache-2.0"
] | null | null | null | from decimal import Decimal
import pytest
from vyper.exceptions import (
ArgumentException,
InvalidType,
StateAccessViolation,
StructureException,
UndeclaredDefinition,
UnknownType,
)
def test_external_contract_calls(get_contract, get_contract_with_gas_estimation):
contract_1 = """
@exte... | 22.954291 | 100 | 0.650843 | from decimal import Decimal
import pytest
from vyper.exceptions import (
ArgumentException,
InvalidType,
StateAccessViolation,
StructureException,
UndeclaredDefinition,
UnknownType,
)
def test_external_contract_calls(get_contract, get_contract_with_gas_estimation):
contract_1 = """
@exte... | true | true |
f74740db426c1d0b29641e37aab58ddf2d55e5ce | 21,701 | py | Python | gallery/tutorial/autotvm_relay_x86.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 90 | 2021-11-30T11:58:10.000Z | 2022-03-31T02:24:04.000Z | gallery/tutorial/autotvm_relay_x86.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 64 | 2021-11-22T23:58:23.000Z | 2022-03-31T03:19:22.000Z | gallery/tutorial/autotvm_relay_x86.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 27 | 2021-12-09T22:39:27.000Z | 2022-03-24T23:21:48.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 45.590336 | 99 | 0.664854 | true | true | |
f74740dd9d56b8dcecd61271bc0b2ca5847345a1 | 1,533 | py | Python | storage/log.py | fchauvel/storage | 42735318718d85713c893d8b0a2fddf460ffcd17 | [
"MIT"
] | null | null | null | storage/log.py | fchauvel/storage | 42735318718d85713c893d8b0a2fddf460ffcd17 | [
"MIT"
] | null | null | null | storage/log.py | fchauvel/storage | 42735318718d85713c893d8b0a2fddf460ffcd17 | [
"MIT"
] | 1 | 2018-09-11T12:01:52.000Z | 2018-09-11T12:01:52.000Z | #
# SensApp::Storage
#
# Copyright (C) 2018 SINTEF Digital
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#
import yaml
import logging
import logging.config
from storage.queues import QueueListener
from storage.db im... | 24.725806 | 78 | 0.688193 |
import yaml
import logging
import logging.config
from storage.queues import QueueListener
from storage.db import DBListener
from storage.sensapp import RegistryListener
STARTING_UP = "Starting ..."
DB_CONNECTED = "Connected to DB '{name}' on {host}:{port}."
QUEUE_CONNECTED = "Connected to message-queue ... | true | true |
f74741241a5c1671f8eaad0d0bef640e9bcc1af8 | 39,505 | py | Python | models/nfnet.py | JayChanHoi/adaptive_gradient_clipping | ab9a7c88bf67843d87919dd51d7b722e063ad2b8 | [
"MIT"
] | 1 | 2021-03-14T15:55:25.000Z | 2021-03-14T15:55:25.000Z | models/nfnet.py | JayChanHoi/adaptive_gradient_clipping | ab9a7c88bf67843d87919dd51d7b722e063ad2b8 | [
"MIT"
] | null | null | null | models/nfnet.py | JayChanHoi/adaptive_gradient_clipping | ab9a7c88bf67843d87919dd51d7b722e063ad2b8 | [
"MIT"
] | null | null | null | """ Normalization Free Nets. NFNet, NF-RegNet, NF-ResNet (pre-activation) Models
Paper: `Characterizing signal propagation to close the performance gap in unnormalized ResNets`
- https://arxiv.org/abs/2101.08692
Paper: `High-Performance Large-Scale Image Recognition Without Normalization`
- https://arxiv.org/... | 42.161153 | 129 | 0.670244 | import math
from dataclasses import dataclass, field
from collections import OrderedDict
from typing import Tuple, Optional
from functools import partial
import torch
import torch.nn as nn
from .helpers import build_model_with_cfg
from .layers import ClassifierHead, DropPath, AvgPool2dSame, ScaledStdConv2d, ScaledSt... | true | true |
f747412c04085f26b2351414e2a407389f589f98 | 461 | py | Python | data/scripts/templates/object/mobile/shared_dressed_commoner_artisan_bith_male_01.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_dressed_commoner_artisan_bith_male_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_dressed_commoner_artisan_bith_male_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_commoner_artisan_bith_male_01.iff"
result.attribute_te... | 27.117647 | 83 | 0.739696 | true | true | |
f747413d92571cc1b3c81399e72ff497438caf61 | 1,027 | py | Python | xor.py | davidlares/xor-encryption | 369e9bdadfce0ac533e56d92622d8a0749411a57 | [
"MIT"
] | null | null | null | xor.py | davidlares/xor-encryption | 369e9bdadfce0ac533e56d92622d8a0749411a57 | [
"MIT"
] | null | null | null | xor.py | davidlares/xor-encryption | 369e9bdadfce0ac533e56d92622d8a0749411a57 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import string
import random
# this will generate a random key used for the XOR encrpytion for 1kb = same as the TCP socket size
key = ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits + '^!\$%&/()=?{[]}+~#-_.:,;<>|\\') for _ in range(1024))
# printing data
print(k... | 34.233333 | 148 | 0.683544 |
import string
import random
key = ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits + '^!\$%&/()=?{[]}+~#-_.:,;<>|\\') for _ in range(1024))
print(key)
print('\n' + 'Key length' + str(len(key)))
message = 'ipconfig'
print("Hardcoded message is: " + message + "\n")
def str_xor... | true | true |
f74741961ca57072c59db5ab77aa0c05719b4ee8 | 2,103 | py | Python | get_subtitles.py | mln00b/youtube-subtitle | b879bb2ccd22a5960a8c26ea2be3f90a3c4acc30 | [
"MIT"
] | null | null | null | get_subtitles.py | mln00b/youtube-subtitle | b879bb2ccd22a5960a8c26ea2be3f90a3c4acc30 | [
"MIT"
] | null | null | null | get_subtitles.py | mln00b/youtube-subtitle | b879bb2ccd22a5960a8c26ea2be3f90a3c4acc30 | [
"MIT"
] | 1 | 2021-12-15T12:18:27.000Z | 2021-12-15T12:18:27.000Z | import os
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api.formatters import JSONFormatter
from argparse import ArgumentParser, Namespace
from tqdm import tqdm
from typing import List
def _get_video_id_from_url(url: str) -> str:
assert "watch?v=" in url, "URL format is incorre... | 34.47541 | 115 | 0.673799 | import os
from youtube_transcript_api import YouTubeTranscriptApi
from youtube_transcript_api.formatters import JSONFormatter
from argparse import ArgumentParser, Namespace
from tqdm import tqdm
from typing import List
def _get_video_id_from_url(url: str) -> str:
assert "watch?v=" in url, "URL format is incorre... | true | true |
f74741c069ee1b6a4ae1b7ff6d986f2ce19bf3a7 | 4,568 | py | Python | level3/prepare_the_bunnies_escape/solution.py | lcsm29/goog-foobar | 6ea44879d9d9f3483fa320d92d6c25b14565c899 | [
"MIT"
] | null | null | null | level3/prepare_the_bunnies_escape/solution.py | lcsm29/goog-foobar | 6ea44879d9d9f3483fa320d92d6c25b14565c899 | [
"MIT"
] | null | null | null | level3/prepare_the_bunnies_escape/solution.py | lcsm29/goog-foobar | 6ea44879d9d9f3483fa320d92d6c25b14565c899 | [
"MIT"
] | null | null | null | def count_step(m, w, h):
m = [[i for i in l] for l in m]
next_pos = [(0, 0)]
while next_pos:
x, y = next_pos.pop(0)
for i, j in ((-1, 0), (1, 0), (0, -1), (0, 1)):
x_, y_ = x + i, y + j
if 0 <= x_ < w and 0 <= y_ < h:
if not m[y_][x_]:
... | 39.042735 | 85 | 0.336033 | def count_step(m, w, h):
m = [[i for i in l] for l in m]
next_pos = [(0, 0)]
while next_pos:
x, y = next_pos.pop(0)
for i, j in ((-1, 0), (1, 0), (0, -1), (0, 1)):
x_, y_ = x + i, y + j
if 0 <= x_ < w and 0 <= y_ < h:
if not m[y_][x_]:
... | true | true |
f747424770a430e5746e2ab2f78345201bd4e217 | 493 | py | Python | scipy/lib/lapack/setupscons.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | 8 | 2015-10-07T00:37:32.000Z | 2022-01-21T17:02:33.000Z | scipy/lib/lapack/setupscons.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | null | null | null | scipy/lib/lapack/setupscons.py | lesserwhirls/scipy-cwt | ee673656d879d9356892621e23ed0ced3d358621 | [
"BSD-3-Clause"
] | 8 | 2015-05-09T14:23:57.000Z | 2018-11-15T05:56:00.000Z | #!/usr/bin/env python
import os
from glob import glob
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('lapack',parent_package,top_path)
config.add_sconscript('SConstruct')
... | 23.47619 | 60 | 0.744422 |
import os
from glob import glob
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
config = Configuration('lapack',parent_package,top_path)
config.add_sconscript('SConstruct')
config.add_data_d... | true | true |
f74742b30c7f6e4f0a6cb009fcffe7a422b6f348 | 6,731 | py | Python | tests/unit/beacons/test_btmp.py | calinrailean/salt | 6283b51bb44b734a3db82caaae4f4c4e32a9b9b3 | [
"Apache-2.0"
] | 2 | 2018-11-08T02:59:24.000Z | 2021-01-04T00:30:50.000Z | tests/unit/beacons/test_btmp.py | The-Loeki/salt | 8ff8212cc1eacfe409eb9cc017b21250f28dd305 | [
"Apache-2.0"
] | 4 | 2020-09-04T10:19:34.000Z | 2020-11-09T12:55:59.000Z | tests/unit/beacons/test_btmp.py | The-Loeki/salt | 8ff8212cc1eacfe409eb9cc017b21250f28dd305 | [
"Apache-2.0"
] | 5 | 2017-06-16T23:48:13.000Z | 2021-04-08T17:43:48.000Z | # coding: utf-8
# Python libs
from __future__ import absolute_import
import logging
# Salt testing libs
from tests.support.unit import skipIf, TestCase
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock, mock_open
from tests.support.mixins import LoaderModuleMockMixin
# Salt libs
import salt.be... | 57.042373 | 1,485 | 0.567821 |
from __future__ import absolute_import
import logging
from tests.support.unit import skipIf, TestCase
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, patch, MagicMock, mock_open
from tests.support.mixins import LoaderModuleMockMixin
import salt.beacons.btmp as btmp
from salt.ext import six
raw = b'\x06\... | true | true |
f7474314b30bb1d5a8ea527a26aa09669052cfe8 | 642 | py | Python | setup.py | benjaminharpin/wangle | 5e6db98e7f7927d612da8410204021e689815cf6 | [
"MIT"
] | null | null | null | setup.py | benjaminharpin/wangle | 5e6db98e7f7927d612da8410204021e689815cf6 | [
"MIT"
] | null | null | null | setup.py | benjaminharpin/wangle | 5e6db98e7f7927d612da8410204021e689815cf6 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='wangle',
version='0.1.3',
author="Ben Harpin",
author_email="benjaminharpin@gmail.com",
description="A python library for natural language manipulation.",
long_description=long_descr... | 29.181818 | 70 | 0.672897 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='wangle',
version='0.1.3',
author="Ben Harpin",
author_email="benjaminharpin@gmail.com",
description="A python library for natural language manipulation.",
long_description=long_descr... | true | true |
f7474325224135894bafb1ad8a851a6ca90d158a | 356 | py | Python | dgp/genera/load/analyzers/file_format/gsheet_format.py | dataspot/dgp | 553a255a4884b935cf2efecdc761050232f0f066 | [
"MIT"
] | 1 | 2019-07-17T11:34:27.000Z | 2019-07-17T11:34:27.000Z | dgp/genera/load/analyzers/file_format/gsheet_format.py | datahq/dgp | f39592ce20ba67b73b08188f14585b6eb3d43f96 | [
"MIT"
] | 2 | 2019-04-30T12:32:32.000Z | 2019-04-30T12:35:26.000Z | dgp/genera/load/analyzers/file_format/gsheet_format.py | dataspot/dgp | 553a255a4884b935cf2efecdc761050232f0f066 | [
"MIT"
] | null | null | null | from .....core import BaseAnalyzer, Validator, Required
from .....config.consts import CONFIG_FORMAT, CONFIG_FORCE_STRINGS
class GSheetFormatAnalyzer(BaseAnalyzer):
REQUIRES = Validator(
Required(CONFIG_FORMAT)
)
def run(self):
if self.config[CONFIG_FORMAT] == 'gsheet':
self.... | 25.428571 | 66 | 0.696629 | from .....core import BaseAnalyzer, Validator, Required
from .....config.consts import CONFIG_FORMAT, CONFIG_FORCE_STRINGS
class GSheetFormatAnalyzer(BaseAnalyzer):
REQUIRES = Validator(
Required(CONFIG_FORMAT)
)
def run(self):
if self.config[CONFIG_FORMAT] == 'gsheet':
self.... | true | true |
f747438358366586d9084873c047f182733c831f | 38,574 | py | Python | keras/layers/dense_attention_test.py | old-school-kid/keras | 326cf80085a9d7d980b968ea1ca235490e32833b | [
"Apache-2.0"
] | null | null | null | keras/layers/dense_attention_test.py | old-school-kid/keras | 326cf80085a9d7d980b968ea1ca235490e32833b | [
"Apache-2.0"
] | null | null | null | keras/layers/dense_attention_test.py | old-school-kid/keras | 326cf80085a9d7d980b968ea1ca235490e32833b | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 44.135011 | 112 | 0.61163 |
import tensorflow.compat.v2 as tf
from absl.testing import parameterized
import numpy as np
import keras
from keras import combinations
from keras import testing_utils
from keras.layers import core
from keras.layers import dense_attention
from keras.mixed_precision import policy
@combinations.generat... | true | true |
f7474475791976c3594638ab0dd1c732889b5a29 | 8,838 | py | Python | sdk/python/pulumi_gcp/kms/get_kms_crypto_key.py | la3mmchen/pulumi-gcp | 0e3c6fecd062dff78a4fd95b7ebd5ce4492ad1ea | [
"ECL-2.0",
"Apache-2.0"
] | 121 | 2018-06-18T19:16:42.000Z | 2022-03-31T06:06:48.000Z | sdk/python/pulumi_gcp/kms/get_kms_crypto_key.py | la3mmchen/pulumi-gcp | 0e3c6fecd062dff78a4fd95b7ebd5ce4492ad1ea | [
"ECL-2.0",
"Apache-2.0"
] | 492 | 2018-06-22T19:41:03.000Z | 2022-03-31T15:33:53.000Z | sdk/python/pulumi_gcp/kms/get_kms_crypto_key.py | la3mmchen/pulumi-gcp | 0e3c6fecd062dff78a4fd95b7ebd5ce4492ad1ea | [
"ECL-2.0",
"Apache-2.0"
] | 43 | 2018-06-19T01:43:13.000Z | 2022-03-23T22:43:37.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 40.541284 | 222 | 0.687825 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
__all__ = [
'GetKMSCryptoKeyResult',
'AwaitableGetKMSCryptoKeyResult',
'get_kms_crypto_key',
'get_kms_crypto_key_output',
]
@pulu... | true | true |
f747450525114f8779287131a65d33e0cf2eb37a | 1,852 | py | Python | src/generative_playground/models/encoder/encoder.py | ZmeiGorynych/generative_playground | 5c336dfbd14235e4fd97b21778842a650e733275 | [
"MIT"
] | 9 | 2018-09-23T17:34:23.000Z | 2021-07-29T09:48:55.000Z | src/generative_playground/models/encoder/encoder.py | ZmeiGorynych/generative_playground | 5c336dfbd14235e4fd97b21778842a650e733275 | [
"MIT"
] | 2 | 2020-04-15T17:52:18.000Z | 2020-04-15T18:26:27.000Z | src/generative_playground/models/encoder/encoder.py | ZmeiGorynych/generative_playground | 5c336dfbd14235e4fd97b21778842a650e733275 | [
"MIT"
] | 6 | 2019-04-30T22:01:43.000Z | 2021-11-22T02:20:18.000Z | from generative_playground.models.encoder.basic_cnn import SimpleCNNEncoder
from generative_playground.models.encoder.basic_rnn import SimpleRNN
from generative_playground.models.heads.attention_aggregating_head import AttentionAggregatingHead
from generative_playground.models.transformer.Models import TransformerEncod... | 50.054054 | 98 | 0.542117 | from generative_playground.models.encoder.basic_cnn import SimpleCNNEncoder
from generative_playground.models.encoder.basic_rnn import SimpleRNN
from generative_playground.models.heads.attention_aggregating_head import AttentionAggregatingHead
from generative_playground.models.transformer.Models import TransformerEncod... | true | true |
f747456615108cf6c3999e493a8f04a003c1b65c | 1,704 | py | Python | utils/allow_flash.py | TestOpsFeng/selenium_framework | 3d7d6fe166d4b450788b73eb52f804363833a11f | [
"Apache-2.0"
] | 7 | 2019-03-18T10:33:40.000Z | 2020-03-10T17:25:17.000Z | utils/allow_flash.py | TestOpsFeng/selenium_framework | 3d7d6fe166d4b450788b73eb52f804363833a11f | [
"Apache-2.0"
] | null | null | null | utils/allow_flash.py | TestOpsFeng/selenium_framework | 3d7d6fe166d4b450788b73eb52f804363833a11f | [
"Apache-2.0"
] | 5 | 2019-03-18T10:33:47.000Z | 2021-04-17T08:16:49.000Z | from urllib.parse import quote_plus as url_quoteplus
from urllib.parse import urlsplit
from selenium.webdriver.common.by import By as WebBy
from selenium.webdriver.support.ui import Select as WebSelect
def allow_flash(driver, url):
def _base_url(url):
if url.find("://") == -1:
url = "http://{}... | 44.842105 | 95 | 0.72007 | from urllib.parse import quote_plus as url_quoteplus
from urllib.parse import urlsplit
from selenium.webdriver.common.by import By as WebBy
from selenium.webdriver.support.ui import Select as WebSelect
def allow_flash(driver, url):
def _base_url(url):
if url.find("://") == -1:
url = "http://{}... | true | true |
f74745823024a0e28bb05c7d7daa838c1f84db0f | 282 | py | Python | pyleecan/Methods/Geometry/Arc3/get_end.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/Methods/Geometry/Arc3/get_end.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/Methods/Geometry/Arc3/get_end.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*-
def get_end(self):
"""Return the end point of the arc
Parameters
----------
self : Arc3
An Arc3 object
Returns
-------
end: complex
Complex coordinates of the end point of the Arc3
"""
return self.end
| 14.842105 | 56 | 0.528369 |
def get_end(self):
return self.end
| true | true |
f747462b46a193c2ea52b43b50a2b2dff1c704d6 | 1,304 | py | Python | example/issues/482_layered_format/app.py | RonnyPfannschmidt/dynaconf | 3223f6586aa6ae3ef7b5cd7d198fb950f5038526 | [
"MIT"
] | 2,293 | 2015-08-14T22:39:31.000Z | 2022-03-31T12:44:49.000Z | example/issues/482_layered_format/app.py | RonnyPfannschmidt/dynaconf | 3223f6586aa6ae3ef7b5cd7d198fb950f5038526 | [
"MIT"
] | 676 | 2015-08-20T19:29:56.000Z | 2022-03-31T13:45:51.000Z | example/issues/482_layered_format/app.py | RonnyPfannschmidt/dynaconf | 3223f6586aa6ae3ef7b5cd7d198fb950f5038526 | [
"MIT"
] | 255 | 2015-12-02T21:16:33.000Z | 2022-03-20T22:03:46.000Z | from dynaconf import Dynaconf
settings_files = ["settings.toml", "other.toml"]
settings = Dynaconf(settings_files=settings_files)
expected_value = "s3a://kewl_bucket"
assert settings.s3_url == expected_value
assert settings.s3_url1 == expected_value
assert settings.s3_url2 == expected_value
assert settings.s3_url3 ... | 24.603774 | 73 | 0.680215 | from dynaconf import Dynaconf
settings_files = ["settings.toml", "other.toml"]
settings = Dynaconf(settings_files=settings_files)
expected_value = "s3a://kewl_bucket"
assert settings.s3_url == expected_value
assert settings.s3_url1 == expected_value
assert settings.s3_url2 == expected_value
assert settings.s3_url3 ... | true | true |
f747465717af7b61ba3d5809bb0103759c609741 | 1,198 | py | Python | hat_bot.py | Ghrek/Hat | cb30786406ffd1803b805e53e49a47e1031e95a6 | [
"MIT"
] | null | null | null | hat_bot.py | Ghrek/Hat | cb30786406ffd1803b805e53e49a47e1031e95a6 | [
"MIT"
] | null | null | null | hat_bot.py | Ghrek/Hat | cb30786406ffd1803b805e53e49a47e1031e95a6 | [
"MIT"
] | null | null | null | from discord.ext import commands
import os
import discord
import random
token = 'token'
bot = discord.Client()
bot = commands.Bot(command_prefix='!')
bot.remove_command('help')
for file in os.listdir("cogs"):
if file.endswith(".py"):
name = file[:-3]
bot.load_extension(f"cogs.{name}... | 36.30303 | 116 | 0.687813 | from discord.ext import commands
import os
import discord
import random
token = 'token'
bot = discord.Client()
bot = commands.Bot(command_prefix='!')
bot.remove_command('help')
for file in os.listdir("cogs"):
if file.endswith(".py"):
name = file[:-3]
bot.load_extension(f"cogs.{name}... | true | true |
f74747271f5d3bf42eb9e4ddfecd242716713e4f | 437 | py | Python | src/etc/stard/filesystems.py | DexterLB/stard | c8433d353367535ed52c143667e1d42b56aee85b | [
"MIT"
] | null | null | null | src/etc/stard/filesystems.py | DexterLB/stard | c8433d353367535ed52c143667e1d42b56aee85b | [
"MIT"
] | null | null | null | src/etc/stard/filesystems.py | DexterLB/stard | c8433d353367535ed52c143667e1d42b56aee85b | [
"MIT"
] | null | null | null | from stard.services import Executable
class Service(Executable):
start_command = ('mount', '-a')
post_start_commands = (
('mount', '-o', 'remount,rw', '/'),
)
stop_command = ('sh', '-c', 'umount -af; true')
post_stop_commands = (
('mount', '-o', 'remount,ro', '/'),
)
onesh... | 23 | 51 | 0.567506 | from stard.services import Executable
class Service(Executable):
start_command = ('mount', '-a')
post_start_commands = (
('mount', '-o', 'remount,rw', '/'),
)
stop_command = ('sh', '-c', 'umount -af; true')
post_stop_commands = (
('mount', '-o', 'remount,ro', '/'),
)
onesh... | true | true |
f74747b189e324008b25d3404bc8817e39045f29 | 7,799 | py | Python | src/you_get/extractors/netease.py | ARTAvrilLavigne/you-get | 904a88841899091415015b297c9293f980c8ba24 | [
"MIT"
] | 48 | 2017-12-24T12:19:55.000Z | 2022-02-26T13:14:27.000Z | src/you_get/extractors/netease.py | T-K-233/you-get | ff6deaf2bde4a8e81094c7ff5893fa4d9b30efb0 | [
"MIT"
] | 6 | 2016-10-19T12:52:06.000Z | 2018-05-26T10:32:51.000Z | src/you_get/extractors/netease.py | T-K-233/you-get | ff6deaf2bde4a8e81094c7ff5893fa4d9b30efb0 | [
"MIT"
] | 113 | 2017-08-09T03:10:04.000Z | 2022-03-26T16:05:01.000Z | #!/usr/bin/env python
__all__ = ['netease_download']
from ..common import *
from ..common import print_more_compatible as print
from ..util import fs
from json import loads
import hashlib
import base64
import os
def netease_hymn():
return """
player's Game Over,
u can abandon.
u get pissed,
get ... | 42.38587 | 169 | 0.597384 |
__all__ = ['netease_download']
from ..common import *
from ..common import print_more_compatible as print
from ..util import fs
from json import loads
import hashlib
import base64
import os
def netease_hymn():
return """
player's Game Over,
u can abandon.
u get pissed,
get pissed,
Halleluja... | true | true |
f74747ef90da8cd6fe6b37a74e293aeb84409af8 | 11,233 | py | Python | app.py | wangonya/cchat | 25484164d3022bc8ca52b6b60bd2cf47f682ff78 | [
"MIT"
] | null | null | null | app.py | wangonya/cchat | 25484164d3022bc8ca52b6b60bd2cf47f682ff78 | [
"MIT"
] | null | null | null | app.py | wangonya/cchat | 25484164d3022bc8ca52b6b60bd2cf47f682ff78 | [
"MIT"
] | null | null | null | import sqlite3
import threading
import notify2
from datetime import datetime
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import parse_qs
from halo import Halo
from prompt_toolkit import ANSI
from prompt_toolkit.application import Application, get_app
from prompt_toolkit.buffer import B... | 34.457055 | 114 | 0.616754 | import sqlite3
import threading
import notify2
from datetime import datetime
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import parse_qs
from halo import Halo
from prompt_toolkit import ANSI
from prompt_toolkit.application import Application, get_app
from prompt_toolkit.buffer import B... | true | true |
f74747fd63350079355397ba5d7eb5c20324d9bc | 2,469 | py | Python | app/lib/db_query/tweets/categories.py | MichaelCurrin/twitterverse | 9629f848377e4346be833db70f11c593cc0d7b6c | [
"MIT"
] | 10 | 2019-03-22T07:07:41.000Z | 2022-01-26T00:57:45.000Z | app/lib/db_query/tweets/categories.py | MichaelCurrin/twitterverse | 9629f848377e4346be833db70f11c593cc0d7b6c | [
"MIT"
] | 70 | 2017-07-12T19:49:38.000Z | 2020-09-02T10:03:28.000Z | app/lib/db_query/tweets/categories.py | MichaelCurrin/twitterverse | 9629f848377e4346be833db70f11c593cc0d7b6c | [
"MIT"
] | 2 | 2017-06-30T07:13:39.000Z | 2020-12-04T00:39:12.000Z | """
Category queries application file.
"""
from lib import database as db
def printAvailableCategories():
"""
Iterate through Categories in db to print out name and Profile count
for each.
:return: None
"""
print(" Category | Profiles")
print("------------------------... | 29.392857 | 80 | 0.567436 | from lib import database as db
def printAvailableCategories():
print(" Category | Profiles")
print("-------------------------------+---------")
categoryResult = db.Category.select()
for i, v in enumerate(categoryResult):
print(
"{index:3d}. {category:25s} | {pr... | true | true |
f7474812853343b99a417134f794f8b54648ff3b | 5,852 | py | Python | docs/src/conf.py | slaclab/rouge | 2a98dd2c758b6bde04e54bdf4e91aaf9504e255e | [
"BSD-3-Clause-LBNL"
] | 26 | 2016-11-02T15:46:29.000Z | 2022-03-18T16:50:00.000Z | docs/src/conf.py | slaclab/rouge | 2a98dd2c758b6bde04e54bdf4e91aaf9504e255e | [
"BSD-3-Clause-LBNL"
] | 419 | 2017-06-07T16:06:22.000Z | 2022-03-25T21:05:17.000Z | docs/src/conf.py | slaclab/rouge | 2a98dd2c758b6bde04e54bdf4e91aaf9504e255e | [
"BSD-3-Clause-LBNL"
] | 12 | 2017-07-25T22:58:08.000Z | 2022-02-17T23:30:05.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Rogue documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 15 13:57:19 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 30.962963 | 95 | 0.679255 |
import rogue
import breathe
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sph... | true | true |
f747483c10d80c5d09d2d15129164a71cb07b228 | 4,284 | py | Python | backend/users/api/views.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | backend/users/api/views.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | backend/users/api/views.py | gitdevstar/tikatok | 78729028f20eda822d9ef36634685feb69d5a3a5 | [
"Apache-2.0"
] | null | null | null | from users.models import Users
from .serializers import UsersSerializer
from rest_framework import viewsets
from django.contrib.auth.hashers import make_password
from rest_framework.response import Response
from rest_framework.decorators import api_view, action
from users.models import Users
from clients.models import ... | 27.818182 | 85 | 0.601541 | from users.models import Users
from .serializers import UsersSerializer
from rest_framework import viewsets
from django.contrib.auth.hashers import make_password
from rest_framework.response import Response
from rest_framework.decorators import api_view, action
from users.models import Users
from clients.models import ... | true | true |
f747489942094fdb9d96922740a78b15a74dec0e | 4,796 | py | Python | pinax/notifications/tests/test_models.py | sherzberg/django-notification | d810e4d6cbbd0e96186df807dd67401f8818d374 | [
"MIT"
] | null | null | null | pinax/notifications/tests/test_models.py | sherzberg/django-notification | d810e4d6cbbd0e96186df807dd67401f8818d374 | [
"MIT"
] | null | null | null | pinax/notifications/tests/test_models.py | sherzberg/django-notification | d810e4d6cbbd0e96186df807dd67401f8818d374 | [
"MIT"
] | null | null | null | import base64
from django.core import mail
from django.utils.six.moves import cPickle as pickle
from django.test import TestCase
from django.test.utils import override_settings
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from ..conf import settings
from ..models import... | 37.46875 | 103 | 0.68015 | import base64
from django.core import mail
from django.utils.six.moves import cPickle as pickle
from django.test import TestCase
from django.test.utils import override_settings
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from ..conf import settings
from ..models import... | true | true |
f7474971492e22c5b28f459c7bf3ba7e80bfc150 | 1,279 | py | Python | example/logo_7_8.py | nikteliy/python-snap7 | 6f8bcb15ad2494fd95880171b974b001d33a5111 | [
"MIT"
] | 412 | 2015-02-25T11:07:09.000Z | 2022-03-28T10:03:09.000Z | example/logo_7_8.py | nikteliy/python-snap7 | 6f8bcb15ad2494fd95880171b974b001d33a5111 | [
"MIT"
] | 240 | 2015-02-24T18:10:13.000Z | 2022-03-22T11:10:09.000Z | example/logo_7_8.py | nikteliy/python-snap7 | 6f8bcb15ad2494fd95880171b974b001d33a5111 | [
"MIT"
] | 238 | 2015-02-24T16:12:32.000Z | 2022-03-30T08:50:29.000Z | import logging
import snap7
# for setup the Logo connection please follow this link
# http://snap7.sourceforge.net/logo.html
logging.basicConfig(level=logging.INFO)
# Siemens LOGO devices Logo 8 is the default
Logo_7 = True
logger = logging.getLogger(__name__)
plc = snap7.logo.Logo()
plc.connect("192.168.0.41",0... | 23.685185 | 68 | 0.645817 | import logging
import snap7
logging.basicConfig(level=logging.INFO)
Logo_7 = True
logger = logging.getLogger(__name__)
plc = snap7.logo.Logo()
plc.connect("192.168.0.41",0x1000,0x2000)
if plc.get_connected():
logger.info("connected")
vm_address = ("V923.0" if Logo_7==True else "V1024.0")
... | true | true |
f74749ad574e549af5156c74722aa49c9d720eee | 3,576 | py | Python | tensorflow/python/framework/framework_lib.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | 7 | 2016-04-24T19:06:10.000Z | 2018-10-03T16:33:51.000Z | tensorflow/python/framework/framework_lib.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/framework_lib.py | smrutiranjans/tensorflow | d8e8b872eae63188c75046d5bb068e03a81b3f85 | [
"Apache-2.0"
] | 3 | 2017-05-24T06:58:14.000Z | 2020-02-15T14:21:00.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.216216 | 80 | 0.81264 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework.ops import Graph
from tensorflow.python.framework.ops import Operation
from tensorflow.python.framework.ops import Tensor
from tensorflow.python.framework.ops ... | true | true |
f7474a1373c21bb00f7cb798beb6317f18e97a79 | 3,807 | py | Python | aiopogo/pogoprotos/networking/responses/get_player_response_pb2.py | DennyLoko/aiopogo | 55a9efe13c51261c68ab2abe8efc4ac69e04eb01 | [
"MIT"
] | 14 | 2017-03-28T16:32:24.000Z | 2021-03-13T23:03:57.000Z | aiopogo/pogoprotos/networking/responses/get_player_response_pb2.py | DennyLoko/aiopogo | 55a9efe13c51261c68ab2abe8efc4ac69e04eb01 | [
"MIT"
] | 8 | 2017-03-01T07:56:09.000Z | 2017-08-15T07:37:12.000Z | aiopogo/pogoprotos/networking/responses/get_player_response_pb2.py | DennyLoko/aiopogo | 55a9efe13c51261c68ab2abe8efc4ac69e04eb01 | [
"MIT"
] | 14 | 2017-04-08T20:01:50.000Z | 2017-08-19T04:23:57.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/responses/get_player_response.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from... | 40.5 | 396 | 0.78093 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
f7474a189b45f9046d3cbf6699be9546d8eebfd1 | 11,398 | py | Python | venv/lib/python3.7/site-packages/celery/backends/mongodb.py | joeybaba/incubator-superset | fc6fc042b4acbc564b69011532a92cf88d21a609 | [
"Apache-2.0"
] | 1 | 2021-09-13T07:49:56.000Z | 2021-09-13T07:49:56.000Z | newenv/lib/python3.8/site-packages/celery/backends/mongodb.py | palakshivlani-11/cryptorium | eebb78c061007519e527b3d18b8df6bc13679c46 | [
"Apache-2.0"
] | 9 | 2021-03-19T03:06:53.000Z | 2022-03-12T00:37:04.000Z | newenv/lib/python3.8/site-packages/celery/backends/mongodb.py | palakshivlani-11/cryptorium | eebb78c061007519e527b3d18b8df6bc13679c46 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""MongoDB result store backend."""
from __future__ import absolute_import, unicode_literals
from datetime import datetime, timedelta
from kombu.exceptions import EncodeError
from kombu.utils.objects import cached_property
from kombu.utils.url import maybe_sanitize_url, urlparse
from celery i... | 34.539394 | 79 | 0.584576 |
from __future__ import absolute_import, unicode_literals
from datetime import datetime, timedelta
from kombu.exceptions import EncodeError
from kombu.utils.objects import cached_property
from kombu.utils.url import maybe_sanitize_url, urlparse
from celery import states
from celery.exceptions import ImproperlyConfig... | true | true |
f7474a398c5a316b12711816b58fb045c86d4e1a | 7,414 | py | Python | yapftests/split_penalty_test.py | nemetris/yapf | 212c5b5ad8e172d2d914ae454c121c89cccbcb35 | [
"Apache-2.0"
] | null | null | null | yapftests/split_penalty_test.py | nemetris/yapf | 212c5b5ad8e172d2d914ae454c121c89cccbcb35 | [
"Apache-2.0"
] | null | null | null | yapftests/split_penalty_test.py | nemetris/yapf | 212c5b5ad8e172d2d914ae454c121c89cccbcb35 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 27.76779 | 79 | 0.578635 |
import sys
import textwrap
import unittest
from lib2to3 import pytree
from yapf.pytree import pytree_utils
from yapf.pytree import pytree_visitor
from yapf.pytree import split_penalty
from yapf.yapflib import style
from yapftests import yapf_test_helper
UNBREAKABLE = split_penalty.UNBREAKABLE
VERY_STR... | true | true |
f7474a67a7116bd40a56fbc2cc7a628d21210378 | 1,562 | py | Python | docker_volume_watcher/cli.py | MariuszWinnik/docker-windows-volume-watcher | d906becdcb819c768ff61c3d4c78fe2291480f92 | [
"MIT"
] | null | null | null | docker_volume_watcher/cli.py | MariuszWinnik/docker-windows-volume-watcher | d906becdcb819c768ff61c3d4c78fe2291480f92 | [
"MIT"
] | null | null | null | docker_volume_watcher/cli.py | MariuszWinnik/docker-windows-volume-watcher | d906becdcb819c768ff61c3d4c78fe2291480f92 | [
"MIT"
] | null | null | null | """
A tool to notify Docker contianers about changes in mounts on Windows.
"""
import re
import argparse
import logging
import pywintypes
from docker_volume_watcher.container_monitor import ContainerMonitor
def main():
"""
Parse command line arguments and start monitoring.
"""
parser = argparse.Argu... | 33.956522 | 99 | 0.678617 | import re
import argparse
import logging
import pywintypes
from docker_volume_watcher.container_monitor import ContainerMonitor
def main():
parser = argparse.ArgumentParser(
description='A tool to notify Docker contianers about changes in mounts on Windows.'
)
parser.add_argument('container_patt... | true | true |
f7474c4b301e0ea093a9d28e778968748adb98fb | 3,296 | py | Python | data_admin/common/api/serializers.py | love1900905/frepple-data-admin | bf5115681005975e83343377b202ba598ddc7055 | [
"MIT"
] | 7 | 2021-04-24T16:26:57.000Z | 2021-09-04T00:31:45.000Z | data_admin/common/api/serializers.py | love1900905/frepple-data-admin | bf5115681005975e83343377b202ba598ddc7055 | [
"MIT"
] | null | null | null | data_admin/common/api/serializers.py | love1900905/frepple-data-admin | bf5115681005975e83343377b202ba598ddc7055 | [
"MIT"
] | 4 | 2021-04-16T14:25:07.000Z | 2022-02-04T12:32:42.000Z | from rest_framework.serializers import ModelSerializer as DefaultModelSerializer
from rest_framework.validators import UniqueValidator, UniqueTogetherValidator
from rest_framework.fields import JSONField
from ..fields import JSONBField
DefaultModelSerializer.serializer_field_mapping[JSONBField] = JSONField
class Mo... | 39.710843 | 80 | 0.614684 | from rest_framework.serializers import ModelSerializer as DefaultModelSerializer
from rest_framework.validators import UniqueValidator, UniqueTogetherValidator
from rest_framework.fields import JSONField
from ..fields import JSONBField
DefaultModelSerializer.serializer_field_mapping[JSONBField] = JSONField
class Mo... | true | true |
f7474ccb88a5353fdeef8637674dd61354991130 | 348 | py | Python | AlexNet/Alexnet_to_onnx.py | Fritingo/AlexNet_on_browser | 3e674dd84e25ee74f2efde77882b4faa788907c2 | [
"MIT"
] | null | null | null | AlexNet/Alexnet_to_onnx.py | Fritingo/AlexNet_on_browser | 3e674dd84e25ee74f2efde77882b4faa788907c2 | [
"MIT"
] | null | null | null | AlexNet/Alexnet_to_onnx.py | Fritingo/AlexNet_on_browser | 3e674dd84e25ee74f2efde77882b4faa788907c2 | [
"MIT"
] | null | null | null | import torch
from inference_Alexnet import AlexNet
def main():
pytorch_model = AlexNet()
pytorch_model.load_state_dict(torch.load('cifar100_Alexnet.pt'))
pytorch_model.eval()
dummy_input = torch.zeros(128*128*4)
torch.onnx.export(pytorch_model, dummy_input, 'cifar100_Alexnet.onnx', verbose=True)
if __nam... | 21.75 | 86 | 0.758621 | import torch
from inference_Alexnet import AlexNet
def main():
pytorch_model = AlexNet()
pytorch_model.load_state_dict(torch.load('cifar100_Alexnet.pt'))
pytorch_model.eval()
dummy_input = torch.zeros(128*128*4)
torch.onnx.export(pytorch_model, dummy_input, 'cifar100_Alexnet.onnx', verbose=True)
if __nam... | true | true |
f7474d843326d97c18cf8a1992d27f47a4b4ca41 | 1,063 | py | Python | pareeksha/pareeksha/urls.py | illusion1993/pareeksha-online-test-platform | 3973ad1b9a9e258280a62f8b28ebbfbb3f2392d7 | [
"MIT"
] | null | null | null | pareeksha/pareeksha/urls.py | illusion1993/pareeksha-online-test-platform | 3973ad1b9a9e258280a62f8b28ebbfbb3f2392d7 | [
"MIT"
] | 1 | 2020-06-05T18:34:13.000Z | 2020-06-05T18:34:13.000Z | pareeksha/pareeksha/urls.py | illusion1993/pareeksha-online-test-platform | 3973ad1b9a9e258280a62f8b28ebbfbb3f2392d7 | [
"MIT"
] | null | null | null | """pareeksha URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | 36.655172 | 79 | 0.71778 | from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import TemplateView
from users import urls as auth_urls
from online_tests import urls as online_test_urls
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api/auth/', include(auth_urls)),
url(r'^ap... | true | true |
f7474dd15421d4537a8195de47828edb4eeec716 | 19,203 | py | Python | tests/cases/query/tests/parsers.py | rysdyk/avocado | 655c1a766be616cb1357ddff8bc345ab61ae9e8a | [
"BSD-2-Clause"
] | null | null | null | tests/cases/query/tests/parsers.py | rysdyk/avocado | 655c1a766be616cb1357ddff8bc345ab61ae9e8a | [
"BSD-2-Clause"
] | null | null | null | tests/cases/query/tests/parsers.py | rysdyk/avocado | 655c1a766be616cb1357ddff8bc345ab61ae9e8a | [
"BSD-2-Clause"
] | 2 | 2020-01-13T20:40:09.000Z | 2020-01-16T15:26:11.000Z | from copy import deepcopy
from django.test import TestCase
from django.core.exceptions import ValidationError
from django.core import management
from avocado.query import oldparsers as parsers
from avocado.models import DataConcept, DataField, DataConceptField
from ....models import Employee
class DataContextParserTe... | 33.396522 | 79 | 0.475447 | from copy import deepcopy
from django.test import TestCase
from django.core.exceptions import ValidationError
from django.core import management
from avocado.query import oldparsers as parsers
from avocado.models import DataConcept, DataField, DataConceptField
from ....models import Employee
class DataContextParserTe... | true | true |
f7474ecb159310ca1054a164e2dbec7ab7e88394 | 3,994 | py | Python | examples/plotStats.py | vincefn/silx | 4b239abfc90d2fa7d6ab61425f8bfc7b83c0f444 | [
"CC0-1.0",
"MIT"
] | null | null | null | examples/plotStats.py | vincefn/silx | 4b239abfc90d2fa7d6ab61425f8bfc7b83c0f444 | [
"CC0-1.0",
"MIT"
] | null | null | null | examples/plotStats.py | vincefn/silx | 4b239abfc90d2fa7d6ab61425f8bfc7b83c0f444 | [
"CC0-1.0",
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2019 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files ... | 32.209677 | 79 | 0.61342 | true | true | |
f7474ee80720831ca1657a4d6aedd394513b32c4 | 600 | py | Python | tests/conftest.py | MaxBird300/NordPoolAPI | 2107e24eb0ef78877eb1a6c8af658fc2f38fd410 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | MaxBird300/NordPoolAPI | 2107e24eb0ef78877eb1a6c8af658fc2f38fd410 | [
"Apache-2.0"
] | null | null | null | tests/conftest.py | MaxBird300/NordPoolAPI | 2107e24eb0ef78877eb1a6c8af658fc2f38fd410 | [
"Apache-2.0"
] | null | null | null | import pytest
def pytest_addoption(parser):
parser.addoption(
"--integration", action="store_true", default=False, help="run integration tests (hits N2EX endpoint)"
)
def pytest_configure(config):
config.addinivalue_line("markers", "integration: mark test as slow to run")
def pytest_collection... | 30 | 110 | 0.706667 | import pytest
def pytest_addoption(parser):
parser.addoption(
"--integration", action="store_true", default=False, help="run integration tests (hits N2EX endpoint)"
)
def pytest_configure(config):
config.addinivalue_line("markers", "integration: mark test as slow to run")
def pytest_collection... | true | true |
f74750628ad4fe2e2b560f66d3c8d9d0196b7aa8 | 1,652 | py | Python | pyvista/plotting/__init__.py | fgallardo-mpie/pyvista | a4f148d3d165648eb871ba45fa39f457377bd10e | [
"MIT"
] | null | null | null | pyvista/plotting/__init__.py | fgallardo-mpie/pyvista | a4f148d3d165648eb871ba45fa39f457377bd10e | [
"MIT"
] | null | null | null | pyvista/plotting/__init__.py | fgallardo-mpie/pyvista | a4f148d3d165648eb871ba45fa39f457377bd10e | [
"MIT"
] | null | null | null | """Plotting routines."""
from pyvista import MAX_N_COLOR_BARS
from .colors import (color_char_to_word, get_cmap_safe, hex_to_rgb, hexcolors,
string_to_rgb, PARAVIEW_BACKGROUND)
from .export_vtkjs import export_plotter_vtkjs, get_vtkjs_url
from .helpers import plot, plot_arrows, plot_compare_four, ... | 34.416667 | 78 | 0.697337 |
from pyvista import MAX_N_COLOR_BARS
from .colors import (color_char_to_word, get_cmap_safe, hex_to_rgb, hexcolors,
string_to_rgb, PARAVIEW_BACKGROUND)
from .export_vtkjs import export_plotter_vtkjs, get_vtkjs_url
from .helpers import plot, plot_arrows, plot_compare_four, plot_itk
from .plotting i... | true | true |
f74751209ae5e4ad5f56488bacf09e5a4eee27b6 | 8,061 | py | Python | src/openfermion/resource_estimates/surface_code_compilation/physical_costing.py | cvmxn1/OpenFermion | cf53c063d0f124a02ff8776bb7f8afb110d4bde6 | [
"Apache-2.0"
] | null | null | null | src/openfermion/resource_estimates/surface_code_compilation/physical_costing.py | cvmxn1/OpenFermion | cf53c063d0f124a02ff8776bb7f8afb110d4bde6 | [
"Apache-2.0"
] | null | null | null | src/openfermion/resource_estimates/surface_code_compilation/physical_costing.py | cvmxn1/OpenFermion | cf53c063d0f124a02ff8776bb7f8afb110d4bde6 | [
"Apache-2.0"
] | null | null | null | #coverage:ignore
import dataclasses
import datetime
import math
from typing import Tuple, Iterator
@dataclasses.dataclass(frozen=True, unsafe_hash=True)
class MagicStateFactory:
details: str
physical_qubit_footprint: int
rounds: int
failure_rate: int
@dataclasses.dataclass(frozen=True, unsafe_hash=T... | 38.754808 | 80 | 0.65972 |
import dataclasses
import datetime
import math
from typing import Tuple, Iterator
@dataclasses.dataclass(frozen=True, unsafe_hash=True)
class MagicStateFactory:
details: str
physical_qubit_footprint: int
rounds: int
failure_rate: int
@dataclasses.dataclass(frozen=True, unsafe_hash=True)
class CostE... | true | true |
f74751a7685df7256e7f60828bd1a0ef48803da3 | 2,106 | py | Python | biothings/web/analytics/notifiers.py | newgene/biothings.api | e3278695ac15a55fe420aa49c464946f81ec019d | [
"Apache-2.0"
] | null | null | null | biothings/web/analytics/notifiers.py | newgene/biothings.api | e3278695ac15a55fe420aa49c464946f81ec019d | [
"Apache-2.0"
] | 2 | 2022-03-18T23:12:02.000Z | 2022-03-18T23:59:42.000Z | biothings/web/analytics/notifiers.py | newgene/biothings.api | e3278695ac15a55fe420aa49c464946f81ec019d | [
"Apache-2.0"
] | null | null | null | from collections import defaultdict
from biothings.web.analytics.channels import SlackChannel, GAChannel
from tornado.httpclient import AsyncHTTPClient
from tornado.web import RequestHandler
class Notifier:
def __init__(self, settings):
self.channels = []
if hasattr(settings, 'SLACK_WEBHOOKS'):... | 30.085714 | 70 | 0.628205 | from collections import defaultdict
from biothings.web.analytics.channels import SlackChannel, GAChannel
from tornado.httpclient import AsyncHTTPClient
from tornado.web import RequestHandler
class Notifier:
def __init__(self, settings):
self.channels = []
if hasattr(settings, 'SLACK_WEBHOOKS'):... | true | true |
f74751cdde49ef201b111fdc5328a6b799e22526 | 915 | py | Python | World 3/Tuples/ex073 - Tuples with Soccer Teams.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 2 | 2021-04-23T19:18:06.000Z | 2021-05-15T17:45:21.000Z | World 3/Tuples/ex073 - Tuples with Soccer Teams.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 1 | 2021-05-14T00:29:23.000Z | 2021-05-14T00:29:23.000Z | World 3/Tuples/ex073 - Tuples with Soccer Teams.py | MiguelChichorro/PythonExercises | 3b2726e7d9ef92c1eb6b977088692c42a2a7b86e | [
"MIT"
] | 1 | 2021-05-14T00:19:33.000Z | 2021-05-14T00:19:33.000Z | colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
teams = ("Fortaleza", "Athletico-PR", "Atlético-GO", "Bragantino", "Bahia", "Fluminense", "Palmeiras", "Fla... | 36.6 | 120 | 0.549727 | colors = {"clean": "\033[m",
"red": "\033[31m",
"green": "\033[32m",
"yellow": "\033[33m",
"blue": "\033[34m",
"purple": "\033[35m",
"cian": "\033[36m"}
teams = ("Fortaleza", "Athletico-PR", "Atlético-GO", "Bragantino", "Bahia", "Fluminense", "Palmeiras", "Fla... | true | true |
f7475334884bbfc81de6163cbb553601437b2d14 | 4,951 | py | Python | examples/lexical_analysis/train.py | ceci3/PaddleNLP | 6c654dde673a84c8f91fb83236c79bcd837f4fae | [
"Apache-2.0"
] | 1 | 2021-03-05T05:12:44.000Z | 2021-03-05T05:12:44.000Z | examples/lexical_analysis/train.py | ceci3/PaddleNLP | 6c654dde673a84c8f91fb83236c79bcd837f4fae | [
"Apache-2.0"
] | null | null | null | examples/lexical_analysis/train.py | ceci3/PaddleNLP | 6c654dde673a84c8f91fb83236c79bcd837f4fae | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 40.252033 | 124 | 0.704908 |
import os
import ast
import math
import argparse
import numpy as np
import paddle
from paddle.static import InputSpec
from paddlenlp.data import Pad, Tuple, Stack
from paddlenlp.layers.crf import LinearChainCrfLoss, ViterbiDecoder
from paddlenlp.metrics import ChunkEvaluator
import distutils.util
from d... | true | true |
f747533cf3eb62070e06005ab2376d2c74376a4b | 6,924 | py | Python | src/CombinedModel.py | duncanmazza/ml_stock_prediction_api | 4cf6325ff1252511049b87bc46fa4d5b48acf4f3 | [
"MIT"
] | 1 | 2020-04-05T20:19:10.000Z | 2020-04-05T20:19:10.000Z | src/CombinedModel.py | duncanmazza/ml_stock_prediction_api | 4cf6325ff1252511049b87bc46fa4d5b48acf4f3 | [
"MIT"
] | null | null | null | src/CombinedModel.py | duncanmazza/ml_stock_prediction_api | 4cf6325ff1252511049b87bc46fa4d5b48acf4f3 | [
"MIT"
] | null | null | null | """
Code for the combined model approach.
@author: Shashank Swaminathan
"""
from src.BayesReg import GPM
from src.StockRNN import StockRNN
import pandas as pd
import numpy as np
from datetime import datetime
from datetime import date
ZERO_TIME = " 00:00:00"
DEVICE = "cuda" # selects the gpu to be used
TO_GPU_FAIL_... | 50.911765 | 344 | 0.657712 |
from src.BayesReg import GPM
from src.StockRNN import StockRNN
import pandas as pd
import numpy as np
from datetime import datetime
from datetime import date
ZERO_TIME = " 00:00:00"
DEVICE = "cuda"
TO_GPU_FAIL_MSG = "Unable to successfully run model.to('{}'). If running in Collaboratory, make sure " \
... | true | true |
f7475439225a682a84e1c58566d9852acdfa7b1d | 26,890 | py | Python | leo/plugins/leo_cloud.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | 1 | 2021-02-08T21:22:38.000Z | 2021-02-08T21:22:38.000Z | leo/plugins/leo_cloud.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | null | null | null | leo/plugins/leo_cloud.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | null | null | null | #@+leo-ver=5-thin
#@+node:ekr.20170925083314.1: * @file ../plugins/leo_cloud.py
#@+<< docstring >>
#@+node:ekr.20210518113636.1: ** << docstring >>
"""
leo_cloud.py - synchronize Leo subtrees with remote central server
Terry N. Brown, terrynbrown@gmail.com, Fri Sep 22 10:34:10 2017
This plugin allows subtrees within ... | 35.428195 | 108 | 0.597917 |
import json
import os
import re
import shlex
import subprocess
import tempfile
import threading
from copy import deepcopy
from datetime import date, datetime
from hashlib import sha1
from leo.core import leoGlobals as g
from leo.core.leoNodes import vnode
from leo.core.leoQt import QtCore
g.assertUi('qt')
... | true | true |
f747545cbb6dccb4ef4edbe33a59907c9da2ed04 | 2,162 | py | Python | simdb/test_old/test_api_get_functions.py | king-michael/simulation_database | 98ed59a599fe47f011c850d65b2941c81974806c | [
"Apache-2.0"
] | null | null | null | simdb/test_old/test_api_get_functions.py | king-michael/simulation_database | 98ed59a599fe47f011c850d65b2941c81974806c | [
"Apache-2.0"
] | null | null | null | simdb/test_old/test_api_get_functions.py | king-michael/simulation_database | 98ed59a599fe47f011c850d65b2941c81974806c | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, generators, nested_scopes, division
import pytest
from reference_database import *
from test_01_storage import test_store_main_table as setup_main_table
import os
from pandas import NaT
import simdb.databaseAPI as api
def setup_module():
setup_main_table()
def map_dateti... | 32.268657 | 93 | 0.624422 | from __future__ import absolute_import, generators, nested_scopes, division
import pytest
from reference_database import *
from test_01_storage import test_store_main_table as setup_main_table
import os
from pandas import NaT
import simdb.databaseAPI as api
def setup_module():
setup_main_table()
def map_dateti... | true | true |
f74755cfb143b17d8705ed510ce499ef7b67ceeb | 416 | py | Python | tests/cli/test_ipfs_scrape.py | corydickson/ethpm-cli | bc25860d6a81d28603d76be06b3a896893324a39 | [
"MIT"
] | 34 | 2019-04-10T17:14:59.000Z | 2022-02-22T11:18:48.000Z | tests/cli/test_ipfs_scrape.py | corydickson/ethpm-cli | bc25860d6a81d28603d76be06b3a896893324a39 | [
"MIT"
] | 65 | 2019-04-10T17:41:07.000Z | 2021-04-02T21:47:27.000Z | tests/cli/test_ipfs_scrape.py | corydickson/ethpm-cli | bc25860d6a81d28603d76be06b3a896893324a39 | [
"MIT"
] | 9 | 2019-04-25T10:35:06.000Z | 2021-06-02T11:06:18.000Z | import pexpect
from ethpm_cli.main import ENTRY_DESCRIPTION
def test_ipfs_scrape(tmp_path):
ipfs_dir = tmp_path / "ipfs"
ipfs_dir.mkdir()
child = pexpect.spawn(f"ethpm scrape --ipfs-dir {ipfs_dir} --start-block 1")
child.expect(ENTRY_DESCRIPTION)
child.expect("\r\n")
child.expect("Scraping fr... | 29.714286 | 80 | 0.713942 | import pexpect
from ethpm_cli.main import ENTRY_DESCRIPTION
def test_ipfs_scrape(tmp_path):
ipfs_dir = tmp_path / "ipfs"
ipfs_dir.mkdir()
child = pexpect.spawn(f"ethpm scrape --ipfs-dir {ipfs_dir} --start-block 1")
child.expect(ENTRY_DESCRIPTION)
child.expect("\r\n")
child.expect("Scraping fr... | true | true |
f74755ebc5b4a57a13cca54986f92da12205f6d0 | 139 | py | Python | 0x08-python-more_classes/0-rectangle.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | 1 | 2019-05-21T09:34:41.000Z | 2019-05-21T09:34:41.000Z | 0x08-python-more_classes/0-rectangle.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | null | null | null | 0x08-python-more_classes/0-rectangle.py | Rmolimock/holbertonschool-higher_level_programming | cf0421cbb6463b3960dc581badf7d4bbe1622b7d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
'''This module contains one class, Rectangle
'''
class Rectangle:
'''Rectangle is an empty class
'''
pass
| 13.9 | 44 | 0.640288 |
class Rectangle:
pass
| true | true |
f747566f5bec559269873c0063047b47930d8d1d | 6,127 | py | Python | src/baxter_interface/head.py | 130s/baxter_interface | aea70d96eb0fb0a99084dcb02d467785dde8fe52 | [
"BSD-3-Clause"
] | 33 | 2015-01-06T19:56:26.000Z | 2021-11-30T10:19:58.000Z | src/baxter_interface/head.py | 130s/baxter_interface | aea70d96eb0fb0a99084dcb02d467785dde8fe52 | [
"BSD-3-Clause"
] | 25 | 2015-01-14T00:33:10.000Z | 2019-11-12T00:19:11.000Z | src/baxter_interface/head.py | 130s/baxter_interface | aea70d96eb0fb0a99084dcb02d467785dde8fe52 | [
"BSD-3-Clause"
] | 60 | 2015-07-22T21:54:01.000Z | 2022-03-08T20:53:43.000Z | # Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditio... | 34.038889 | 77 | 0.605353 |
from copy import deepcopy
from math import fabs
import rospy
from std_msgs.msg import (
Bool
)
import baxter_dataflow
from baxter_core_msgs.msg import (
HeadPanCommand,
HeadState,
)
from baxter_interface import settings
class Head(object):
def __init__(self):
self.... | true | true |
f74757fd20c147065ba748cf72ebd3e20c4c94d2 | 4,907 | py | Python | heat/tests/test_dbinstance.py | jasondunsmore/heat | 6bd7352dc4838b8ef782f2345a4dfdf57ba3e356 | [
"Apache-2.0"
] | 1 | 2015-12-18T21:46:55.000Z | 2015-12-18T21:46:55.000Z | heat/tests/test_dbinstance.py | jasondunsmore/heat | 6bd7352dc4838b8ef782f2345a4dfdf57ba3e356 | [
"Apache-2.0"
] | null | null | null | heat/tests/test_dbinstance.py | jasondunsmore/heat | 6bd7352dc4838b8ef782f2345a4dfdf57ba3e356 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:37:03.000Z | 2021-03-21T11:37:03.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 30.104294 | 78 | 0.58977 |
from heat.common import template_format
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import stack as parser
from heat.engine import template
from heat.tests import common
from heat.tests import ut... | true | true |
f747580f6197f3f7bbc084f2de11a067326d1d2a | 1,347 | py | Python | esphome/components/rgbw/light.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 249 | 2018-04-07T12:04:11.000Z | 2019-01-25T01:11:34.000Z | esphome/components/rgbw/light.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 243 | 2018-04-11T16:37:11.000Z | 2019-01-25T16:50:37.000Z | esphome/components/rgbw/light.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 40 | 2018-04-10T05:50:14.000Z | 2019-01-25T15:20:36.000Z | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import light, output
from esphome.const import (
CONF_BLUE,
CONF_COLOR_INTERLOCK,
CONF_GREEN,
CONF_RED,
CONF_OUTPUT_ID,
CONF_WHITE,
)
rgbw_ns = cg.esphome_ns.namespace("rgbw")
RGBWLightOutput = rgbw_ns.c... | 32.853659 | 70 | 0.729027 | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import light, output
from esphome.const import (
CONF_BLUE,
CONF_COLOR_INTERLOCK,
CONF_GREEN,
CONF_RED,
CONF_OUTPUT_ID,
CONF_WHITE,
)
rgbw_ns = cg.esphome_ns.namespace("rgbw")
RGBWLightOutput = rgbw_ns.c... | true | true |
f74758d8338130b4d2860ed97fbeb43ef74d6be7 | 22,203 | py | Python | core/controllers/feedback_test.py | gauravzqa/oppia | 52a859f251eeb8729834551bfda9f577b06f29e9 | [
"Apache-2.0"
] | 1 | 2019-01-31T18:48:50.000Z | 2019-01-31T18:48:50.000Z | core/controllers/feedback_test.py | debck/oppia | 7126b42bf105724cb82dd2d4df377e7a35c3ca18 | [
"Apache-2.0"
] | null | null | null | core/controllers/feedback_test.py | debck/oppia | 7126b42bf105724cb82dd2d4df377e7a35c3ca18 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 40.005405 | 80 | 0.634374 |
from core.domain import exp_domain
from core.domain import exp_services
from core.domain import feedback_services
from core.domain import rights_manager
from core.domain import state_domain
from core.domain import suggestion_services
from core.domain import user_services
from core.platform import model... | true | true |
f74759c51c2068ae977ddbd17243e3f921ef0bfb | 2,484 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/prefix_14ff2c47c83ae14aa22718e67f21f827.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/prefix_14ff2c47c83ae14aa22718e67f21f827.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/prefix_14ff2c47c83ae14aa22718e67f21f827.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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, ... | 38.8125 | 138 | 0.688003 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class Prefix(Base):
__slots__ = ()
_SDM_NAME = 'prefix'
_SDM_ATT_MAP = {
'Prefix': 'prefix',
}
def __init__(self, parent):
super(Prefix, self).__init__(parent)
... | true | true |
f7475ae2c548bcc5bf7fd66c8400e9baf449d6c9 | 1,508 | py | Python | src/proposals/admin.py | jneo8/pycon.tw | 2c8eb9d8f06febe678292b1bd77ae0bfca005098 | [
"MIT"
] | 1 | 2019-04-04T12:17:26.000Z | 2019-04-04T12:17:26.000Z | src/proposals/admin.py | jneo8/pycon.tw | 2c8eb9d8f06febe678292b1bd77ae0bfca005098 | [
"MIT"
] | null | null | null | src/proposals/admin.py | jneo8/pycon.tw | 2c8eb9d8f06febe678292b1bd77ae0bfca005098 | [
"MIT"
] | 2 | 2019-04-04T12:18:04.000Z | 2019-04-14T13:57:57.000Z | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from import_export.admin import ExportMixin
from .models import AdditionalSpeaker, TalkProposal, TutorialProposal
from .resources import TalkProposalResource
class AdditionalSpeakerInline(GenericTabularInline):
m... | 31.416667 | 69 | 0.699602 | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from import_export.admin import ExportMixin
from .models import AdditionalSpeaker, TalkProposal, TutorialProposal
from .resources import TalkProposalResource
class AdditionalSpeakerInline(GenericTabularInline):
m... | true | true |
f7475bb8b5de350a47db09e414de0d52652399a4 | 19,063 | py | Python | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/BaseHTTPServer.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 9 | 2019-11-22T04:58:40.000Z | 2022-02-26T16:47:28.000Z | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/BaseHTTPServer.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | null | null | null | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/BaseHTTPServer.py | bidhata/EquationGroupLeaks | 1ff4bc115cb2bd5bf2ed6bf769af44392926830c | [
"Unlicense"
] | 8 | 2017-09-27T10:31:18.000Z | 2022-01-08T10:30:46.000Z | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: BaseHTTPServer.py
"""HTTP server base class.
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple impl... | 39.797495 | 219 | 0.614122 |
"""HTTP server base class.
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple implementations of GET, HEAD and POST
(including CGI scripts). It does, however, optionally implement HTTP/1.1
persistent connections, as of version 0.3.
Contents:
- BaseHTTPRequestHand... | false | true |
f7475cfda9d36b72a1bc06e51333dc2cc89d1535 | 12,735 | py | Python | cw/__init__.py | ankkks/CardWirthPy-Lite | cfa9f4315b8adcf01a3ebb40237f2e8ee5f02f45 | [
"bzip2-1.0.6"
] | null | null | null | cw/__init__.py | ankkks/CardWirthPy-Lite | cfa9f4315b8adcf01a3ebb40237f2e8ee5f02f45 | [
"bzip2-1.0.6"
] | null | null | null | cw/__init__.py | ankkks/CardWirthPy-Lite | cfa9f4315b8adcf01a3ebb40237f2e8ee5f02f45 | [
"bzip2-1.0.6"
] | 1 | 2022-03-16T07:49:27.000Z | 2022-03-16T07:49:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import traceback
import wx
import pygame
import util
import battle
import yadodb
import data
import dice
import effectmotion
import event
import eventhandler
import eventrelay
import features
import scenariodb
import setting
imp... | 29.009112 | 110 | 0.600314 |
import os
import sys
import traceback
import wx
import pygame
import util
import battle
import yadodb
import data
import dice
import effectmotion
import event
import eventhandler
import eventrelay
import features
import scenariodb
import setting
import skin
import animation
import thread
imp... | true | true |
f7475dd268e2c73fb725ba14450f11075d606a80 | 914 | py | Python | oneruns/testSetCreation.py | CSC522-Data-mining-NCSU/jf_alg2 | cfd31806325c3d19b1bdc467070e7d56e9ff52c3 | [
"MIT"
] | null | null | null | oneruns/testSetCreation.py | CSC522-Data-mining-NCSU/jf_alg2 | cfd31806325c3d19b1bdc467070e7d56e9ff52c3 | [
"MIT"
] | null | null | null | oneruns/testSetCreation.py | CSC522-Data-mining-NCSU/jf_alg2 | cfd31806325c3d19b1bdc467070e7d56e9ff52c3 | [
"MIT"
] | null | null | null | import csv,pdb
import mysql.connector
import random
Movie2test = []
for i in range(100):
m = random.randint(1,14000)
if m not in Movie2test: Movie2test.append(m)
Movie2test = sorted(Movie2test)
"""
connecting the database...
"""
cnx = mysql.connector.connect(user='root', password = '54321', host = '127.0.0.1'... | 21.255814 | 104 | 0.624726 | import csv,pdb
import mysql.connector
import random
Movie2test = []
for i in range(100):
m = random.randint(1,14000)
if m not in Movie2test: Movie2test.append(m)
Movie2test = sorted(Movie2test)
cnx = mysql.connector.connect(user='root', password = '54321', host = '127.0.0.1', database = 'Netflix')
cursor = cn... | true | true |
f7475e2f07409f71287b64d4c8f3b526991d586d | 892 | py | Python | wxpy_uploader.py | youngorsu/HyperLPR | 077f6ccfb0c80631e1cafe7998dfc8643a6fc09e | [
"Apache-2.0"
] | 13 | 2018-06-20T08:48:15.000Z | 2019-03-07T01:50:07.000Z | wxpy_uploader.py | zhyj3038/HyperLPR | ca83708064df798f1b7bfd607ebeb47e59f71117 | [
"Apache-2.0"
] | null | null | null | wxpy_uploader.py | zhyj3038/HyperLPR | ca83708064df798f1b7bfd607ebeb47e59f71117 | [
"Apache-2.0"
] | 5 | 2018-06-20T09:13:18.000Z | 2020-04-10T15:24:45.000Z | #coding=utf-8
from wxpy import *
import numpy
import cv2
import time
import os
from hyperlpr import pipline
def recognize(filename):
image = cv2.imread(filename)
#通过文件名读入一张图片 放到 image中
return pipline.RecognizePlateJson(image)
#识别一张图片并返回json结果
# 人脸检测的功能,这里用到了OpenCV里面的人脸检测代码
# 由于接收和处理图片都需要一点点时间 这里偷懒直接用... | 19.822222 | 44 | 0.705157 |
from wxpy import *
import numpy
import cv2
import time
import os
from hyperlpr import pipline
def recognize(filename):
image = cv2.imread(filename)
return pipline.RecognizePlateJson(image)
bot = Bot(console_qr=True, cache_path=True)
@bot.register(Friend,PICTURE)
def face_msg(msg):
imag... | false | true |
f7475eb378882f460e6bafbe12258d05e6159221 | 3,037 | py | Python | archive_test.py | lcombs15/WikiArchive | 3096af08159ace55d70b9be35ee3c1d561e7d1a2 | [
"MIT"
] | null | null | null | archive_test.py | lcombs15/WikiArchive | 3096af08159ace55d70b9be35ee3c1d561e7d1a2 | [
"MIT"
] | null | null | null | archive_test.py | lcombs15/WikiArchive | 3096af08159ace55d70b9be35ee3c1d561e7d1a2 | [
"MIT"
] | null | null | null | import unittest
from datetime import datetime
import archive
class TestArchive(unittest.TestCase):
"""
Various unit tests for wiki.web.archive
Lucas Combs
April 2019
"""
def test_remove_file_extension(self):
"""
Verify that the file extension is removed.
... | 33.01087 | 117 | 0.608824 | import unittest
from datetime import datetime
import archive
class TestArchive(unittest.TestCase):
def test_remove_file_extension(self):
file = "readme.md"
self.assertEqual("readme", archive.remove_file_extension(file))
def test_get_file_extension(self):
file = "notes.txt"
s... | true | true |
f7475f692e7389074b03194337f1098216fc6abc | 10,592 | py | Python | pyyoutube/models/video.py | w3Abhishek/python-youtube | e5830e035c41aa8164ca6932e3be7f05b0bec63c | [
"MIT"
] | 156 | 2019-09-01T13:57:49.000Z | 2022-03-31T13:51:21.000Z | pyyoutube/models/video.py | w3Abhishek/python-youtube | e5830e035c41aa8164ca6932e3be7f05b0bec63c | [
"MIT"
] | 88 | 2019-10-20T16:08:50.000Z | 2022-02-08T10:50:54.000Z | pyyoutube/models/video.py | niwla23/python-youtube-async | f4acb4cbced3b3bd25b8e3f0f095da57525a79d9 | [
"MIT"
] | 33 | 2019-10-15T17:46:38.000Z | 2022-01-30T04:50:49.000Z | """
These are video related models.
"""
from dataclasses import dataclass, field
from typing import Optional, List
import isodate
from isodate import ISO8601Error
from pyyoutube.error import ErrorCode, ErrorMessage, PyYouTubeException
from .base import BaseModel
from .common import (
BaseApiResponse,
Base... | 42.709677 | 112 | 0.719505 | from dataclasses import dataclass, field
from typing import Optional, List
import isodate
from isodate import ISO8601Error
from pyyoutube.error import ErrorCode, ErrorMessage, PyYouTubeException
from .base import BaseModel
from .common import (
BaseApiResponse,
BaseTopicDetails,
BaseResource,
Localize... | true | true |
f74760075253d5375f3f5902cdbb59941fc80449 | 29,720 | py | Python | openmdao/solvers/test/test_ln_direct.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 17 | 2018-01-11T20:13:59.000Z | 2022-03-22T03:46:05.000Z | openmdao/solvers/test/test_ln_direct.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 6 | 2017-10-19T23:14:14.000Z | 2020-11-22T17:30:57.000Z | openmdao/solvers/test/test_ln_direct.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 10 | 2018-04-12T22:13:33.000Z | 2020-05-07T10:02:59.000Z | """ Unit test for the DirectSolver linear solver. """
import unittest
import numpy as np
from openmdao.api import Group, Problem, IndepVarComp, ExecComp, DirectSolver, \
LinearGaussSeidel, Newton
from openmdao.core.test.test_residual_sign import SimpleImplicitSL
from openmdao.test.converge_di... | 38.249678 | 90 | 0.576245 |
import unittest
import numpy as np
from openmdao.api import Group, Problem, IndepVarComp, ExecComp, DirectSolver, \
LinearGaussSeidel, Newton
from openmdao.core.test.test_residual_sign import SimpleImplicitSL
from openmdao.test.converge_diverge import ConvergeDiverge, SingleDiamond, \
... | true | true |
f7476037b81b0cbe4c30fd11ab91f9d6a5148e0b | 3,471 | py | Python | data-processing/common/commands/detect_entities.py | rishamsidhu/scholar-reader | fa97cd5fb57305ff96ac060e225d1c331da31654 | [
"Apache-2.0"
] | null | null | null | data-processing/common/commands/detect_entities.py | rishamsidhu/scholar-reader | fa97cd5fb57305ff96ac060e225d1c331da31654 | [
"Apache-2.0"
] | null | null | null | data-processing/common/commands/detect_entities.py | rishamsidhu/scholar-reader | fa97cd5fb57305ff96ac060e225d1c331da31654 | [
"Apache-2.0"
] | 1 | 2020-10-23T12:36:11.000Z | 2020-10-23T12:36:11.000Z | import os.path
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Iterator, Type
from common import directories, file_utils
from common.commands.base import ArxivBatchCommand
from common.parse_tex import EntityExtractor
from common.types import ArxivId, FileContents, RelativePath,... | 36.15625 | 98 | 0.680207 | import os.path
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Iterator, Type
from common import directories, file_utils
from common.commands.base import ArxivBatchCommand
from common.parse_tex import EntityExtractor
from common.types import ArxivId, FileContents, RelativePath,... | true | true |
f74760934633233eb7d56b71d556000e3b6c44f2 | 18,119 | py | Python | utils/dataset.py | ad6398/Pointer-Generator-NW | 4bf997453fb8570fe04668318ca3861cb7d23ecf | [
"MIT"
] | null | null | null | utils/dataset.py | ad6398/Pointer-Generator-NW | 4bf997453fb8570fe04668318ca3861cb7d23ecf | [
"MIT"
] | null | null | null | utils/dataset.py | ad6398/Pointer-Generator-NW | 4bf997453fb8570fe04668318ca3861cb7d23ecf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import csv
import glob
import time
import queue
import struct
import numpy as np
import tensorflow as tf
from random import shuffle
from threading import Thread
from tensorflow.core.example import example_pb2
from utils import utils
from utils import config
import random
random.seed(1234)
#... | 47.933862 | 133 | 0.621006 |
import csv
import glob
import time
import queue
import struct
import numpy as np
import tensorflow as tf
from random import shuffle
from threading import Thread
from tensorflow.core.example import example_pb2
from utils import utils
from utils import config
import random
random.seed(1234)
SENTENCE_STA = '<s>'
SE... | true | true |
f7476285d7b4b83aa9c5cdc17c515647752b01b1 | 10,370 | py | Python | opta/core/aws.py | wpride/opta | 04b745019af595464f4a8060b9bffa2399c137e0 | [
"Apache-2.0"
] | null | null | null | opta/core/aws.py | wpride/opta | 04b745019af595464f4a8060b9bffa2399c137e0 | [
"Apache-2.0"
] | null | null | null | opta/core/aws.py | wpride/opta | 04b745019af595464f4a8060b9bffa2399c137e0 | [
"Apache-2.0"
] | null | null | null | import json
from time import sleep
from typing import TYPE_CHECKING, List, Optional, TypedDict
import boto3
from botocore.config import Config
from mypy_boto3_dynamodb import DynamoDBClient
from opta.utils import fmt_msg, logger
if TYPE_CHECKING:
from opta.layer import Layer, StructuredConfig
class AwsArn(Type... | 35.392491 | 98 | 0.585632 | import json
from time import sleep
from typing import TYPE_CHECKING, List, Optional, TypedDict
import boto3
from botocore.config import Config
from mypy_boto3_dynamodb import DynamoDBClient
from opta.utils import fmt_msg, logger
if TYPE_CHECKING:
from opta.layer import Layer, StructuredConfig
class AwsArn(Type... | true | true |
f74763949c6952e8e479913681e5c30a711f900c | 806 | py | Python | tasks/migrations/0005_auto_20191231_1702.py | madhu0309/Django-Crm | a07b250372d996a29bd567cf7aa365cf66fb9c05 | [
"MIT"
] | null | null | null | tasks/migrations/0005_auto_20191231_1702.py | madhu0309/Django-Crm | a07b250372d996a29bd567cf7aa365cf66fb9c05 | [
"MIT"
] | null | null | null | tasks/migrations/0005_auto_20191231_1702.py | madhu0309/Django-Crm | a07b250372d996a29bd567cf7aa365cf66fb9c05 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-12-31 11:32
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('tasks', '0004_task_teams... | 29.851852 | 163 | 0.653846 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('tasks', '0004_task_teams'),
]
operations = [
migration... | true | true |
f74763d27dc505854c6287253f292b315ac0cd1f | 349 | py | Python | practice/check.py | veterinarian-5300/Genious-Python-Code-Generator | d78cd5f4b64221e8e4dc80d6e1f5ba0a4c613bcd | [
"Apache-2.0"
] | 1 | 2021-09-27T06:24:21.000Z | 2021-09-27T06:24:21.000Z | practice/check.py | veterinarian-5300/Genious-Python-Code-Generator | d78cd5f4b64221e8e4dc80d6e1f5ba0a4c613bcd | [
"Apache-2.0"
] | null | null | null | practice/check.py | veterinarian-5300/Genious-Python-Code-Generator | d78cd5f4b64221e8e4dc80d6e1f5ba0a4c613bcd | [
"Apache-2.0"
] | null | null | null | import csv
import pandas as pd
one=pd.read_csv("pa_dashboards.csv")
two=pd.read_csv("pa_dashboards(1).csv", squeeze=True)
pattern = '|'.join(two)
exist=one['sentences'].str.contains(pattern, na=False)
with open('new.csv', 'w') as outFile:
for cols in exist:
if pattern in exist:
... | 21.8125 | 55 | 0.638968 | import csv
import pandas as pd
one=pd.read_csv("pa_dashboards.csv")
two=pd.read_csv("pa_dashboards(1).csv", squeeze=True)
pattern = '|'.join(two)
exist=one['sentences'].str.contains(pattern, na=False)
with open('new.csv', 'w') as outFile:
for cols in exist:
if pattern in exist:
... | true | true |
f74763fc24a56e7ff3e01edc54fcd401e84bdc96 | 2,147 | py | Python | emis_account/conf.py | tnemisteam/cdf-steps | 78896eebd08ba9975a2dece97f73dca9aa781238 | [
"MIT"
] | null | null | null | emis_account/conf.py | tnemisteam/cdf-steps | 78896eebd08ba9975a2dece97f73dca9aa781238 | [
"MIT"
] | null | null | null | emis_account/conf.py | tnemisteam/cdf-steps | 78896eebd08ba9975a2dece97f73dca9aa781238 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import importlib
from django.utils.translation import get_language_info
import pytz
from appconf import AppConf
def load_path_attr(path):
i = path.rfind(".")
mo... | 33.030769 | 95 | 0.736842 | from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import importlib
from django.utils.translation import get_language_info
import pytz
from appconf import AppConf
def load_path_attr(path):
i = path.rfind(".")
mo... | true | true |
f747647fbd9801603a2bf9add0de1ac40d15360e | 87 | py | Python | example/Tensor/to_.py | j9263178/Cytnx | cf7fb1cff75c1cea14fbbc370fd8e4d86d0ddc8b | [
"Apache-2.0"
] | 11 | 2020-04-14T15:45:42.000Z | 2022-03-31T14:37:03.000Z | example/Tensor/to_.py | j9263178/Cytnx | cf7fb1cff75c1cea14fbbc370fd8e4d86d0ddc8b | [
"Apache-2.0"
] | 38 | 2019-08-02T15:15:51.000Z | 2022-03-04T19:07:02.000Z | example/Tensor/to_.py | j9263178/Cytnx | cf7fb1cff75c1cea14fbbc370fd8e4d86d0ddc8b | [
"Apache-2.0"
] | 7 | 2019-07-17T07:50:55.000Z | 2021-07-03T06:44:52.000Z | from cytnx import *
A = Tensor([3,4,5])
A.to_(Device.cuda+0);
print(A.device_str())
| 10.875 | 21 | 0.643678 | from cytnx import *
A = Tensor([3,4,5])
A.to_(Device.cuda+0);
print(A.device_str())
| true | true |
f74764998b64cb3499c9e028cc1c98cbc6265ff7 | 1,952 | py | Python | examples/plotting/server/boxplot.py | csaid/bokeh | 4312b2de1a15fb24884fcd97eaf6442bf8b4bd7b | [
"BSD-3-Clause"
] | 1 | 2021-07-27T07:41:35.000Z | 2021-07-27T07:41:35.000Z | examples/plotting/server/boxplot.py | csaid/bokeh | 4312b2de1a15fb24884fcd97eaf6442bf8b4bd7b | [
"BSD-3-Clause"
] | null | null | null | examples/plotting/server/boxplot.py | csaid/bokeh | 4312b2de1a15fb24884fcd97eaf6442bf8b4bd7b | [
"BSD-3-Clause"
] | null | null | null | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
import numpy as np
import pandas as pd
from bokeh.plotting import *
# Generate some synthetic time series for six different categories
cats = list("abcdef")
y = np.random.randn(2000)
g = np.random.choice(cats, 2000)
for i, l in en... | 28.705882 | 95 | 0.69416 |
import numpy as np
import pandas as pd
from bokeh.plotting import *
cats = list("abcdef")
y = np.random.randn(2000)
g = np.random.choice(cats, 2000)
for i, l in enumerate(cats):
y[g == l] += i // 2
df = pd.DataFrame(dict(score=y, group=g))
groups = df.groupby('group')
q1 = groups.quantile(q=0.25)
q2 = groups... | true | true |
f74764e648f3ff99e1848d4e86bd6769d5790fcd | 4,321 | py | Python | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/compare_wt_dt_vs_accuracy_galewsky/postprocessing_consolidate.py | valentinaschueller/sweet | 27e99c7a110c99deeadee70688c186d82b39ac90 | [
"MIT"
] | 6 | 2017-11-20T08:12:46.000Z | 2021-03-11T15:32:36.000Z | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/compare_wt_dt_vs_accuracy_galewsky/postprocessing_consolidate.py | valentinaschueller/sweet | 27e99c7a110c99deeadee70688c186d82b39ac90 | [
"MIT"
] | 4 | 2018-02-02T21:46:33.000Z | 2022-01-11T11:10:27.000Z | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/compare_wt_dt_vs_accuracy_galewsky/postprocessing_consolidate.py | valentinaschueller/sweet | 27e99c7a110c99deeadee70688c186d82b39ac90 | [
"MIT"
] | 12 | 2016-03-01T18:33:34.000Z | 2022-02-08T22:20:31.000Z | #! /usr/bin/env python3
import sys
import math
from SWEET import *
from mule.plotting.Plotting import *
from mule.postprocessing.JobsData import *
from mule.postprocessing.JobsDataConsolidate import *
sys.path.append('../')
import pretty_plotting as pp
sys.path.pop()
mule_plotting_usetex(False)
groups = ['runtime.... | 21.713568 | 129 | 0.635964 |
import sys
import math
from SWEET import *
from mule.plotting.Plotting import *
from mule.postprocessing.JobsData import *
from mule.postprocessing.JobsDataConsolidate import *
sys.path.append('../')
import pretty_plotting as pp
sys.path.pop()
mule_plotting_usetex(False)
groups = ['runtime.timestepping_method']
... | true | true |
f74765e3fda1055437e0f1dcf82a6fc99577ed57 | 832 | py | Python | python/mesh/generic/checksum.py | MinesJA/meshNetwork | 5ffada57c13049cb00c2996fe239cdff6edf6f17 | [
"NASA-1.3"
] | 133 | 2017-06-24T02:44:28.000Z | 2022-03-25T05:17:00.000Z | python/mesh/generic/checksum.py | MinesJA/meshNetwork | 5ffada57c13049cb00c2996fe239cdff6edf6f17 | [
"NASA-1.3"
] | null | null | null | python/mesh/generic/checksum.py | MinesJA/meshNetwork | 5ffada57c13049cb00c2996fe239cdff6edf6f17 | [
"NASA-1.3"
] | 33 | 2017-06-19T03:24:40.000Z | 2022-02-03T20:13:12.000Z | from struct import unpack
def calc8bitFletcherChecksum(msgBytes):
"""Calculate 8-bit Fletcher checksum for Li-1 radio packets.
Args:
msgBytes: Raw message bytes to calculate checksum of.
"""
ck_A = 0
ck_B = 0
for msgByte in msgBytes:
ck_A += int(msgByte)
ck_B += ck_A
... | 24.470588 | 64 | 0.655048 | from struct import unpack
def calc8bitFletcherChecksum(msgBytes):
ck_A = 0
ck_B = 0
for msgByte in msgBytes:
ck_A += int(msgByte)
ck_B += ck_A
return [ck_A & 0xFF, ck_B & 0xFF]
def compareChecksum(msgBytes, checksumBytes):
checksum = calc8bitFletcherChecksum(msgBytes)
msgChec... | true | true |
f74765f67d2a9809809fc4d6b90d3484da153e21 | 1,638 | py | Python | indra/databases/mondo_client.py | dianakolusheva/indra | 9dc1ad43457bf1a722384b00c84d18103d728594 | [
"BSD-2-Clause"
] | 136 | 2016-02-11T22:06:37.000Z | 2022-03-31T17:26:20.000Z | indra/databases/mondo_client.py | dianakolusheva/indra | 9dc1ad43457bf1a722384b00c84d18103d728594 | [
"BSD-2-Clause"
] | 748 | 2016-02-03T16:27:56.000Z | 2022-03-09T14:27:54.000Z | indra/databases/mondo_client.py | dianakolusheva/indra | 9dc1ad43457bf1a722384b00c84d18103d728594 | [
"BSD-2-Clause"
] | 56 | 2015-08-28T14:03:44.000Z | 2022-02-04T06:15:55.000Z | # -*- coding: utf-8 -*-
"""A client to the Monarch Disease Ontology (MONDO)."""
from typing import Optional
from indra.databases.obo_client import OboClient
_client = OboClient(prefix='mondo')
def get_name_from_id(mondo_id: str) -> Optional[str]:
"""Return the name corresponding to the given MONDO ID.
Pa... | 24.088235 | 78 | 0.659951 |
from typing import Optional
from indra.databases.obo_client import OboClient
_client = OboClient(prefix='mondo')
def get_name_from_id(mondo_id: str) -> Optional[str]:
return _client.get_name_from_id(mondo_id)
def get_id_from_name(mondo_name: str) -> Optional[str]:
return _client.get_id_from_name(mondo_... | true | true |
f74765f6de32fcd71aee29f64f7acb8210b4f00d | 5,407 | py | Python | assets/icon.py | jonfrs/IC-USP | 628c9ab2e2844e37aff17975929ee46946239483 | [
"Unlicense",
"MIT"
] | null | null | null | assets/icon.py | jonfrs/IC-USP | 628c9ab2e2844e37aff17975929ee46946239483 | [
"Unlicense",
"MIT"
] | 3 | 2021-09-23T13:40:19.000Z | 2021-09-25T19:57:07.000Z | assets/icon.py | jonfrs/IC-USP | 628c9ab2e2844e37aff17975929ee46946239483 | [
"Unlicense",
"MIT"
] | null | null | null | import atexit
import binascii
import os
import tempfile
iconhexdata = '00000100010032321000000000007007000016000000280000003200000064' \
'00000001000400000000000807000000000000000000000000000000000000' \
'00000000000080000080000000808000800000008000800080800000808080' \
'00c0c... | 67.5875 | 80 | 0.764564 | import atexit
import binascii
import os
import tempfile
iconhexdata = '00000100010032321000000000007007000016000000280000003200000064' \
'00000001000400000000000807000000000000000000000000000000000000' \
'00000000000080000080000000808000800000008000800080800000808080' \
'00c0c... | true | true |
f747668a1d4ffdf58b2f39ef7d7bbb8ac29b9a69 | 4,110 | py | Python | cvxpy/atoms/max.py | NunoEdgarGFlowHub/cvxpy | 43270fcc8af8fc4742f1b3519800b0074f2e6693 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/atoms/max.py | NunoEdgarGFlowHub/cvxpy | 43270fcc8af8fc4742f1b3519800b0074f2e6693 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/atoms/max.py | NunoEdgarGFlowHub/cvxpy | 43270fcc8af8fc4742f1b3519800b0074f2e6693 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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 Software Foundation, either version 3 of the License, or
(at your option) any later version.
CVXPY is distributed i... | 30.220588 | 78 | 0.60438 |
from cvxpy.atoms.atom import Atom
from cvxpy.atoms.axis_atom import AxisAtom
import cvxpy.lin_ops.lin_utils as lu
import numpy as np
class max(AxisAtom):
def __init__(self, x, axis=None, keepdims=False):
super(max, self).__init__(x, axis=axis, keepdims=keepdims)
@Atom.numpy_numeric
def numeric(... | true | true |
f74766b394c7478c0db1c7e117d71d7afe454999 | 56 | py | Python | supplychainpy/distribution/air_frieght_transport.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 231 | 2016-05-30T02:34:45.000Z | 2022-03-28T17:00:29.000Z | supplychainpy/distribution/air_frieght_transport.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 77 | 2016-03-23T16:28:34.000Z | 2021-09-30T22:08:03.000Z | supplychainpy/distribution/air_frieght_transport.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 103 | 2016-08-10T19:53:09.000Z | 2022-03-16T16:34:38.000Z | class FreightPlane:
def __init__(self):
pass | 18.666667 | 23 | 0.642857 | class FreightPlane:
def __init__(self):
pass | true | true |
f74767552402b48bcd1d69237fd901733836e70f | 2,106 | py | Python | setup.py | scriptsboy/spotify-downloader | 44f64530efc9a125614e947381d37049408c3674 | [
"MIT"
] | 1 | 2019-01-24T10:47:42.000Z | 2019-01-24T10:47:42.000Z | setup.py | AlfredoSequeida/spotify-downloader | 42620838d03a1cdb6a33a799f2bb23c04ce0404a | [
"MIT"
] | null | null | null | setup.py | AlfredoSequeida/spotify-downloader | 42620838d03a1cdb6a33a799f2bb23c04ce0404a | [
"MIT"
] | 1 | 2018-12-11T02:45:42.000Z | 2018-12-11T02:45:42.000Z | from setuptools import setup
with open("README.md", "r") as f:
long_description = f.read()
import spotdl
setup(
# 'spotify-downloader' was already taken :/
name="spotdl",
# Tests are included automatically:
# https://docs.python.org/3.6/distutils/sourcedist.html#specifying-the-files-to-distribute... | 32.4 | 112 | 0.583571 | from setuptools import setup
with open("README.md", "r") as f:
long_description = f.read()
import spotdl
setup(
name="spotdl",
on=spotdl.__version__,
install_requires=[
"pathlib >= 1.0.1",
"youtube_dl >= 2017.9.26",
"pafy >= 0.5.3.1",
"spotipy >= 2.4.4",
... | true | true |
f747676dd9137268238231e5d311a67c9383f452 | 3,334 | py | Python | flake8_pantsbuild_test.py | Eric-Arellano/flake8-pantsbuild | 58a1d448ad0ec5266ed4d872edd1f859aa298cbe | [
"Apache-2.0"
] | 1 | 2020-10-28T07:43:31.000Z | 2020-10-28T07:43:31.000Z | flake8_pantsbuild_test.py | Eric-Arellano/flake8-pantsbuild | 58a1d448ad0ec5266ed4d872edd1f859aa298cbe | [
"Apache-2.0"
] | 4 | 2020-01-06T05:26:00.000Z | 2022-02-11T17:12:04.000Z | flake8_pantsbuild_test.py | Eric-Arellano/flake8-pantsbuild | 58a1d448ad0ec5266ed4d872edd1f859aa298cbe | [
"Apache-2.0"
] | 3 | 2020-01-05T19:53:59.000Z | 2021-12-03T22:25:12.000Z | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
from textwrap import dedent
from flake8_pantsbuild import PB10, PB11, PB12, PB13, PB20, PB30
def test_pb_10(flake8dir) -> None:
template = dedent(
"""\
... | 25.450382 | 97 | 0.5021 |
import itertools
from textwrap import dedent
from flake8_pantsbuild import PB10, PB11, PB12, PB13, PB20, PB30
def test_pb_10(flake8dir) -> None:
template = dedent(
"""\
import os.path
class Example:
CONSTANT = "foo"
def foo(self, value):
retur... | true | true |
f747681ccdd41b36997741f185415fac14660c8d | 1,179 | py | Python | src/main/python/libraries/edge/writer/proxywriter.py | mayadebellis/incubator-sdap-edge | c0899e508a06d614aa58ec9e991443640ba39e65 | [
"Apache-2.0"
] | null | null | null | src/main/python/libraries/edge/writer/proxywriter.py | mayadebellis/incubator-sdap-edge | c0899e508a06d614aa58ec9e991443640ba39e65 | [
"Apache-2.0"
] | null | null | null | src/main/python/libraries/edge/writer/proxywriter.py | mayadebellis/incubator-sdap-edge | c0899e508a06d614aa58ec9e991443640ba39e65 | [
"Apache-2.0"
] | 1 | 2021-01-10T21:19:05.000Z | 2021-01-10T21:19:05.000Z | import logging
import requestresponder
from edge.httputility import HttpUtility
class ProxyWriter(requestresponder.RequestResponder):
def __init__(self, configFilePath):
super(ProxyWriter, self).__init__(configFilePath)
def get(self, requestHandler):
super(ProxyWriter, self).get(requestHandle... | 35.727273 | 96 | 0.661578 | import logging
import requestresponder
from edge.httputility import HttpUtility
class ProxyWriter(requestresponder.RequestResponder):
def __init__(self, configFilePath):
super(ProxyWriter, self).__init__(configFilePath)
def get(self, requestHandler):
super(ProxyWriter, self).get(requestHandle... | true | true |
f747685812d204b4b966d72ff30f7eb27b1e8c12 | 4,942 | py | Python | experiments/severity_scan_imagenet.py | damien911224/augmentation-corruption | 4cf22bd3be1d100635fb6cd41e9b71a6949b5dd0 | [
"MIT"
] | 25 | 2021-02-22T17:40:16.000Z | 2022-03-15T00:17:27.000Z | experiments/severity_scan_imagenet.py | damien911224/augmentation-corruption | 4cf22bd3be1d100635fb6cd41e9b71a6949b5dd0 | [
"MIT"
] | 2 | 2021-06-17T17:30:43.000Z | 2021-06-28T17:37:49.000Z | experiments/severity_scan_imagenet.py | damien911224/augmentation-corruption | 4cf22bd3be1d100635fb6cd41e9b71a6949b5dd0 | [
"MIT"
] | 10 | 2021-03-23T22:32:23.000Z | 2022-03-23T08:35:33.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import hydra
from hydra.utils import instantiate
import logging
from overlap.train_net import train_net
from overlap.test_net import test_net
... | 35.3 | 100 | 0.612707 |
import hydra
from hydra.utils import instantiate
import logging
from overlap.train_net import train_net
from overlap.test_net import test_net
import numpy as np
import torch
import pickle
import os
import omegaconf
from overlap.extract_features import extract_features
import submitit
log = logging.getLogger(__nam... | true | true |
f74768c592d82df9db76577eac041936b623c3ac | 1,216 | py | Python | application/commands.py | pachecobruno/python-ddd | 81812848a567d4605df346ef3630718d320706cc | [
"MIT"
] | null | null | null | application/commands.py | pachecobruno/python-ddd | 81812848a567d4605df346ef3630718d320706cc | [
"MIT"
] | null | null | null | application/commands.py | pachecobruno/python-ddd | 81812848a567d4605df346ef3630718d320706cc | [
"MIT"
] | null | null | null | from enum import Enum
from schematics.exceptions import DataError
from schematics.models import Model
from schematics.types import StringType, DateTimeType, DecimalType
class ResultStatus(str, Enum):
OK = 'ok'
PENDING = 'pending'
ERROR = 'error'
class CommandResult(object):
def __init__(self, statu... | 22.943396 | 83 | 0.634046 | from enum import Enum
from schematics.exceptions import DataError
from schematics.models import Model
from schematics.types import StringType, DateTimeType, DecimalType
class ResultStatus(str, Enum):
OK = 'ok'
PENDING = 'pending'
ERROR = 'error'
class CommandResult(object):
def __init__(self, statu... | true | true |
f7476a5182210a327217e92453521ab8734d71ac | 2,219 | py | Python | examples/example_normals.py | francisengelmann/PyViz3D | de4543cd437839f4a2193541b1029867d8ddc254 | [
"MIT"
] | 54 | 2020-06-15T01:01:40.000Z | 2022-01-25T21:36:44.000Z | examples/example_normals.py | francisengelmann/PyViz3D | de4543cd437839f4a2193541b1029867d8ddc254 | [
"MIT"
] | 1 | 2021-08-17T14:34:56.000Z | 2021-08-17T14:34:56.000Z | examples/example_normals.py | francisengelmann/pyviz3d | 51e49788e2aafc522920cbde7c48e962aca8e7b5 | [
"MIT"
] | 4 | 2020-06-24T09:46:18.000Z | 2021-12-09T08:56:16.000Z | import numpy as np
import pyviz3d.visualizer as viz
def create_color_palette():
return np.array([
(0, 0, 0),
(174, 199, 232), # wall
(152, 223, 138), # floor
(31, 119, 180), # cabinet
(255, 187, 120), # bed
(188, 189, 34), # chair
(140, 86, 75), # sofa
... | 29.197368 | 113 | 0.537179 | import numpy as np
import pyviz3d.visualizer as viz
def create_color_palette():
return np.array([
(0, 0, 0),
(174, 199, 232),
(152, 223, 138),
(31, 119, 180),
(255, 187, 120),
(188, 189, 34),
(140, 86, 75),
(255, 152, 150),
(214, 39,... | true | true |
f7476c4869408ef313b407bedb9ec1dfd6a1052e | 40,725 | py | Python | phono3py/cui/settings.py | lyuwen/phono3py | 9e2adffa6c07abb4bdbe4e4188c460cb8a0462fd | [
"BSD-3-Clause"
] | null | null | null | phono3py/cui/settings.py | lyuwen/phono3py | 9e2adffa6c07abb4bdbe4e4188c460cb8a0462fd | [
"BSD-3-Clause"
] | null | null | null | phono3py/cui/settings.py | lyuwen/phono3py | 9e2adffa6c07abb4bdbe4e4188c460cb8a0462fd | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from phonopy.cui.settings import Settings, ConfParser, fracval
class Phono3pySettings(Settings):
def __init__(self):
Settings.__init__(self)
self._boundary_mfp = 1.0e6 # In micrometre. The default value is
# just set to avoid divergence.
... | 38.275376 | 87 | 0.600786 | import numpy as np
from phonopy.cui.settings import Settings, ConfParser, fracval
class Phono3pySettings(Settings):
def __init__(self):
Settings.__init__(self)
self._boundary_mfp = 1.0e6
self._coarse_mesh_shifts = None
self._const_ave_pp = None
... | true | true |
f7476d118d5b5200aa99d51ac469f8db64b443c9 | 4,494 | py | Python | test/test_web_transport.py | djzelenak/espa-web | dda9e1744675e62fce6ca5c500ce6b90e940fc7e | [
"Unlicense"
] | null | null | null | test/test_web_transport.py | djzelenak/espa-web | dda9e1744675e62fce6ca5c500ce6b90e940fc7e | [
"Unlicense"
] | null | null | null | test/test_web_transport.py | djzelenak/espa-web | dda9e1744675e62fce6ca5c500ce6b90e940fc7e | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import unittest
from mock import patch
from mock import MagicMock
from flask import request
from StringIO import StringIO
from src.app import espaweb
from src.mocks import app as mock_app
from src.utils import User
class ApplicationTestCase(unittest.TestCase):
def setUp(self):
sel... | 35.952 | 92 | 0.639297 |
import unittest
from mock import patch
from mock import MagicMock
from flask import request
from StringIO import StringIO
from src.app import espaweb
from src.mocks import app as mock_app
from src.utils import User
class ApplicationTestCase(unittest.TestCase):
def setUp(self):
self.app = espaweb.test_... | true | true |
f7476e069d0024e5e5f18abb03294bc2d47136a0 | 313 | py | Python | schrutepy/schrutepy.py | bputman/schrutepy | 68f18a4e47a77bcfc92e0f76c3ba6bb135add65c | [
"MIT"
] | 23 | 2020-01-18T17:32:23.000Z | 2022-03-24T23:27:57.000Z | schrutepy/schrutepy.py | bputman/schrutepy | 68f18a4e47a77bcfc92e0f76c3ba6bb135add65c | [
"MIT"
] | 89 | 2020-01-17T23:29:44.000Z | 2022-01-24T20:16:39.000Z | schrutepy/schrutepy.py | bputman/schrutepy | 68f18a4e47a77bcfc92e0f76c3ba6bb135add65c | [
"MIT"
] | 6 | 2020-01-20T17:40:34.000Z | 2022-01-24T20:05:32.000Z | import pandas
def load_schrute():
"""
The entire script transcriptions from The Office in pandas dataframe format.
"""
full_path = "https://github.com/bradlindblad/schrutepy/raw/master/data/schrute.csv"
df = pandas.read_csv(full_path)
df = df.drop("Unnamed: 0", axis=1)
return df
| 20.866667 | 87 | 0.680511 | import pandas
def load_schrute():
full_path = "https://github.com/bradlindblad/schrutepy/raw/master/data/schrute.csv"
df = pandas.read_csv(full_path)
df = df.drop("Unnamed: 0", axis=1)
return df
| true | true |
f7476f5d319aa3aa28c366de8f746f0a5d7ea1ab | 22,594 | py | Python | ml/rl/test/gym/world_model/mdnrnn_gym.py | joshrose/Horizon | a2eb407b31a16560ae78aa6751eb83672a122a7e | [
"BSD-3-Clause"
] | 2 | 2021-01-11T18:16:32.000Z | 2021-11-30T09:34:58.000Z | ml/rl/test/gym/world_model/mdnrnn_gym.py | joshrose/Horizon | a2eb407b31a16560ae78aa6751eb83672a122a7e | [
"BSD-3-Clause"
] | null | null | null | ml/rl/test/gym/world_model/mdnrnn_gym.py | joshrose/Horizon | a2eb407b31a16560ae78aa6751eb83672a122a7e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
"""
Learn a world model on gym environments
"""
import argparse
import json
import logging
import sys
from typing import Dict, Optional
import ml.rl.types as rlt
import numpy as np
import torch
from ml.rl.evaluation.world_mo... | 35.138414 | 88 | 0.631893 |
import argparse
import json
import logging
import sys
from typing import Dict, Optional
import ml.rl.types as rlt
import numpy as np
import torch
from ml.rl.evaluation.world_model_evaluator import (
FeatureImportanceEvaluator,
FeatureSensitivityEvaluator,
)
from ml.rl.json_serialize import json_to_object
fro... | true | true |
f7476fe572e6e49074eacad7bd57546fc4f88c7a | 20,317 | py | Python | model_service/model_service.py | Derikka/simulacrum | 99c4db9b15913c3c838532a86569645b3345fb83 | [
"BSD-3-Clause-LBNL"
] | 3 | 2019-01-17T20:52:41.000Z | 2019-04-29T19:01:37.000Z | model_service/model_service.py | Derikka/simulacrum | 99c4db9b15913c3c838532a86569645b3345fb83 | [
"BSD-3-Clause-LBNL"
] | 28 | 2019-02-16T01:25:55.000Z | 2021-01-27T19:30:31.000Z | model_service/model_service.py | Derikka/simulacrum | 99c4db9b15913c3c838532a86569645b3345fb83 | [
"BSD-3-Clause-LBNL"
] | 13 | 2019-02-22T19:38:06.000Z | 2022-03-21T20:10:44.000Z | #!/usr/bin/env python3
import os
import argparse
import sys
import pickle
import asyncio
import time
import numpy as np
import zmq
import pytao
from p4p.nt import NTTable
from p4p.server import Server as PVAServer
from p4p.server.asyncio import SharedPV
from zmq.asyncio import Context
import simulacrum
model_service_... | 50.041872 | 234 | 0.576266 |
import os
import argparse
import sys
import pickle
import asyncio
import time
import numpy as np
import zmq
import pytao
from p4p.nt import NTTable
from p4p.server import Server as PVAServer
from p4p.server.asyncio import SharedPV
from zmq.asyncio import Context
import simulacrum
model_service_dir = os.path.dirname(... | true | true |
f747705b79cf18241f46aa8154a08eeeddb3f71d | 4,095 | py | Python | basis/trimesh/io/stl.py | takuya-ki/wrs | f6e1009b94332504042fbde9b39323410394ecde | [
"MIT"
] | 23 | 2021-04-02T09:02:04.000Z | 2022-03-22T05:31:03.000Z | basis/trimesh/io/stl.py | takuya-ki/wrs | f6e1009b94332504042fbde9b39323410394ecde | [
"MIT"
] | 35 | 2021-04-12T09:41:05.000Z | 2022-03-26T13:32:46.000Z | basis/trimesh/io/stl.py | takuya-ki/wrs | f6e1009b94332504042fbde9b39323410394ecde | [
"MIT"
] | 16 | 2021-03-30T11:55:45.000Z | 2022-03-30T07:10:59.000Z | import numpy as np
from ..util import is_binary_file
# define a numpy datatype for the STL file
_stl_dtype = np.dtype([('normals', np.float32, (3)), ('vertices', np.float32, (3, 3)), ('attributes', np.uint16)])
_stl_dtype_header = np.dtype([('header', np.void, 80), ('face_count', np.int32)])
def load_stl(file_obj, ... | 36.5625 | 114 | 0.658608 | import numpy as np
from ..util import is_binary_file
_stl_dtype = np.dtype([('normals', np.float32, (3)), ('vertices', np.float32, (3, 3)), ('attributes', np.uint16)])
_stl_dtype_header = np.dtype([('header', np.void, 80), ('face_count', np.int32)])
def load_stl(file_obj, file_type=None):
if 'b' not in file_ob... | true | true |
f7477137b77e1f838e3c3e9c8021ffe3657bb0d4 | 138 | py | Python | appPortas/tests.py | ValerioMedeiros/SCEFA | 9028b575f8813e309c01061f0c1f58776e225ae7 | [
"MIT"
] | null | null | null | appPortas/tests.py | ValerioMedeiros/SCEFA | 9028b575f8813e309c01061f0c1f58776e225ae7 | [
"MIT"
] | 4 | 2018-10-23T21:41:11.000Z | 2019-02-16T16:34:39.000Z | appPortas/tests.py | ValerioMedeiros/SCEFA | 9028b575f8813e309c01061f0c1f58776e225ae7 | [
"MIT"
] | 3 | 2019-01-20T01:34:41.000Z | 2019-10-21T20:32:46.000Z | from appPortas.models import *
from appPonto.models import *
from datetime import datetime
pessoa = Pessoa.objects.get(id)
print(pessoa)
| 19.714286 | 31 | 0.797101 | from appPortas.models import *
from appPonto.models import *
from datetime import datetime
pessoa = Pessoa.objects.get(id)
print(pessoa)
| true | true |
f7477222468ff70fd3f1e29ef6c4a4e08e89fbea | 435 | py | Python | python/2018/day01.py | BastiHz/Advent_of_Code | e018b4d7499e760e9b761f87334f251d4adc05fe | [
"MIT"
] | 3 | 2020-12-10T20:01:03.000Z | 2021-01-03T09:24:59.000Z | python/2018/day01.py | BastiHz/Advent_of_Code | e018b4d7499e760e9b761f87334f251d4adc05fe | [
"MIT"
] | 3 | 2020-12-21T12:23:06.000Z | 2020-12-29T20:37:32.000Z | python/2018/day01.py | BastiHz/Advent_of_Code | e018b4d7499e760e9b761f87334f251d4adc05fe | [
"MIT"
] | null | null | null | # https://adventofcode.com/2018/day/1
with open("../../input/2018-01-input.txt") as file:
changes = [int(i) for i in file.read().splitlines()]
# part 1
print(sum(changes)) # 561
# part 2
frequency = 0
i = 0
seen = set()
while True:
for change in changes:
if frequency in seen:
break
... | 16.730769 | 56 | 0.590805 |
with open("../../input/2018-01-input.txt") as file:
changes = [int(i) for i in file.read().splitlines()]
print(sum(changes))
frequency = 0
i = 0
seen = set()
while True:
for change in changes:
if frequency in seen:
break
seen.add(frequency)
frequency += change
... | true | true |
f7477232dd597ebbb478d582b8bdf0fbea31c3ce | 1,401 | py | Python | run.py | hushyangqing/flsim | 1e0f955ba8b1227f6ba6cab300ec6adffc1cbbf6 | [
"Apache-2.0"
] | 97 | 2019-12-12T10:26:25.000Z | 2022-03-28T08:44:47.000Z | run.py | hushyangqing/flsim | 1e0f955ba8b1227f6ba6cab300ec6adffc1cbbf6 | [
"Apache-2.0"
] | 10 | 2020-07-24T13:40:00.000Z | 2022-03-26T18:48:27.000Z | run.py | hushyangqing/flsim | 1e0f955ba8b1227f6ba6cab300ec6adffc1cbbf6 | [
"Apache-2.0"
] | 41 | 2019-12-19T03:32:39.000Z | 2022-03-25T15:35:26.000Z | import argparse
import client
import config
import logging
import os
import server
# Set up parser
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', type=str, default='./config.json',
help='Federated learning configuration file.')
parser.add_argument('-l', '--log', type=str,... | 27.470588 | 117 | 0.656674 | import argparse
import client
import config
import logging
import os
import server
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', type=str, default='./config.json',
help='Federated learning configuration file.')
parser.add_argument('-l', '--log', type=str, default='INFO'... | true | true |
f74773bb55fd8bd468129de638101cd8bf7b2401 | 3,500 | py | Python | twitter_elections/sentiment_analysis/labeliseurs/old/autolabeliser.py | verycourt/Elections | b954c2bb23422e85d10074d41f7d2adc537a1766 | [
"MIT"
] | null | null | null | twitter_elections/sentiment_analysis/labeliseurs/old/autolabeliser.py | verycourt/Elections | b954c2bb23422e85d10074d41f7d2adc537a1766 | [
"MIT"
] | null | null | null | twitter_elections/sentiment_analysis/labeliseurs/old/autolabeliser.py | verycourt/Elections | b954c2bb23422e85d10074d41f7d2adc537a1766 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#-*- coding: utf-8 -*-
import pymongo as pym
import re
def removeDuplicates():
client = pym.MongoClient()
c = client.tweet.tweet
duplicates = []
removepipe = [{"$group":{"_id":"$t_id", "dups":{"$push":"$_id"},"count":{"$sum":1}}},{"$match":{"count":{"$gt":1}}}]
try :
for ... | 40.229885 | 141 | 0.634 |
import pymongo as pym
import re
def removeDuplicates():
client = pym.MongoClient()
c = client.tweet.tweet
duplicates = []
removepipe = [{"$group":{"_id":"$t_id", "dups":{"$push":"$_id"},"count":{"$sum":1}}},{"$match":{"count":{"$gt":1}}}]
try :
for doc in c.aggregate(removepipe) :
... | true | true |
f7477544fa541d4bc682bc36ff9632891521f67b | 259 | py | Python | tests/unit/transport/test_systemssh.py | dmulyalin/scrapli_netconf | 7c9e5e74a1afac7955177db759e54d2211637d42 | [
"MIT"
] | 61 | 2020-05-17T19:57:25.000Z | 2022-03-30T01:10:32.000Z | tests/unit/transport/test_systemssh.py | dmulyalin/scrapli_netconf | 7c9e5e74a1afac7955177db759e54d2211637d42 | [
"MIT"
] | 79 | 2020-05-17T20:22:05.000Z | 2022-03-02T14:37:28.000Z | tests/unit/transport/test_systemssh.py | dmulyalin/scrapli_netconf | 7c9e5e74a1afac7955177db759e54d2211637d42 | [
"MIT"
] | 6 | 2021-01-07T16:45:28.000Z | 2022-02-11T19:31:49.000Z | from scrapli_netconf.driver import NetconfDriver
from scrapli_netconf.transport.plugins.system.transport import NetconfSystemTransport
def test_init():
conn = NetconfDriver(host="localhost")
assert isinstance(conn.transport, NetconfSystemTransport)
| 32.375 | 85 | 0.830116 | from scrapli_netconf.driver import NetconfDriver
from scrapli_netconf.transport.plugins.system.transport import NetconfSystemTransport
def test_init():
conn = NetconfDriver(host="localhost")
assert isinstance(conn.transport, NetconfSystemTransport)
| true | true |
f74775c24d19a95b1ff3498348f0a316a9ff73d8 | 576 | py | Python | revizor/utils.py | bureaucratic-labs/revizor | 725ba02cf70302ebea81207e68a8f93eaf863e1c | [
"MIT"
] | 15 | 2021-06-07T10:56:11.000Z | 2022-03-03T20:35:30.000Z | revizor/utils.py | bureaucratic-labs/revizor | 725ba02cf70302ebea81207e68a8f93eaf863e1c | [
"MIT"
] | 2 | 2021-10-02T11:13:45.000Z | 2022-01-20T07:12:28.000Z | revizor/utils.py | bureaucratic-labs/revizor | 725ba02cf70302ebea81207e68a8f93eaf863e1c | [
"MIT"
] | 6 | 2021-07-28T03:37:22.000Z | 2021-12-19T13:34:21.000Z | from functools import partial
from typing import List, Optional
from flair.data import Span
def _get_text_from_spans(text: str, spans: List[Span], tag: str) -> Optional[str]:
for span in spans:
if span.tag == tag:
return text[span.start_pos : span.end_pos]
return None
_get_type_from_spa... | 32 | 82 | 0.758681 | from functools import partial
from typing import List, Optional
from flair.data import Span
def _get_text_from_spans(text: str, spans: List[Span], tag: str) -> Optional[str]:
for span in spans:
if span.tag == tag:
return text[span.start_pos : span.end_pos]
return None
_get_type_from_spa... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.