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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c03c85dbea73c814d35f8269bdf283f3effb2df | 3,970 | py | Python | openstack_dashboard/views.py | hemantsonawane95/horizon-apelby | 01a5e72219aeca8c1451701ee85e232ed0618751 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/views.py | hemantsonawane95/horizon-apelby | 01a5e72219aeca8c1451701ee85e232ed0618751 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/views.py | hemantsonawane95/horizon-apelby | 01a5e72219aeca8c1451701ee85e232ed0618751 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 34.521739 | 79 | 0.657935 |
from importlib import import_module
import logging
import urllib
from django.conf import settings
from django import http
from django import shortcuts
from django import urls
from django.utils.encoding import smart_str
import django.views.decorators.vary
from django.views.generic import TemplateView
import horizon
f... | true | true |
1c03c8d88f16a57762937fadaa9a100e77a55e1d | 271 | py | Python | load.py | yuj09161/group | 69ff6e1d988a979968d267c83a901a0567828fd9 | [
"MIT"
] | null | null | null | load.py | yuj09161/group | 69ff6e1d988a979968d267c83a901a0567828fd9 | [
"MIT"
] | null | null | null | load.py | yuj09161/group | 69ff6e1d988a979968d267c83a901a0567828fd9 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt,json
with open('export.json','w') as file:
json.dump(res,file)
for k in range(len(res)):
x=[]
y=[]
for j in range(len(res[k])):
x.append(res[k][j][0])
y.append(res[k][j][1])
plt.scatter(x,y)
plt.show() | 20.846154 | 37 | 0.564576 | import matplotlib.pyplot as plt,json
with open('export.json','w') as file:
json.dump(res,file)
for k in range(len(res)):
x=[]
y=[]
for j in range(len(res[k])):
x.append(res[k][j][0])
y.append(res[k][j][1])
plt.scatter(x,y)
plt.show() | true | true |
1c03c90078f3fd19c122d9213cf096dcf5963542 | 2,211 | py | Python | FWCore/Integration/test/testLooperEventNavigation2_cfg.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | FWCore/Integration/test/testLooperEventNavigation2_cfg.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | FWCore/Integration/test/testLooperEventNavigation2_cfg.py | Purva-Chaudhari/cmssw | 32e5cbfe54c4d809d60022586cf200b7c3020bcf | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'file:testProcessBlockMerge.root',
'file:testProcessBlockMerge2.root'
)
)
# 57 transitions = 12 events + 15 access input ProcessBlock transitions... | 52.642857 | 199 | 0.636364 | import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'file:testProcessBlockMerge.root',
'file:testProcessBlockMerge2.root'
)
)
process.readProcessBlocksOneAnalyzer = cms.EDAnalyzer("edmtest::one::In... | true | true |
1c03c9b09a98b65de001742543fd4c1dcb8452c7 | 1,903 | py | Python | test/test_client.py | m-pilia/mli | 2e351cd98dbc9e689e252b823bb2ba63ac028716 | [
"MIT"
] | 1 | 2020-04-14T13:05:42.000Z | 2020-04-14T13:05:42.000Z | test/test_client.py | m-pilia/mli | 2e351cd98dbc9e689e252b823bb2ba63ac028716 | [
"MIT"
] | 1 | 2020-04-14T19:08:22.000Z | 2020-04-14T19:08:22.000Z | test/test_client.py | m-pilia/mli | 2e351cd98dbc9e689e252b823bb2ba63ac028716 | [
"MIT"
] | null | null | null | import argparse
import io
import json
import unittest
import unittest.mock as mock
import mli.client
class TestClient(unittest.TestCase):
@mock.patch('socket.socket', autospec=True)
def test_request(self, socket_mock):
connection_mock = socket_mock.return_value.__enter__.return_value
connect... | 30.693548 | 112 | 0.613768 | import argparse
import io
import json
import unittest
import unittest.mock as mock
import mli.client
class TestClient(unittest.TestCase):
@mock.patch('socket.socket', autospec=True)
def test_request(self, socket_mock):
connection_mock = socket_mock.return_value.__enter__.return_value
connect... | true | true |
1c03ca70dc37347c62784b59d508d88e36d0ce31 | 6,892 | py | Python | test/test_consumer.py | duruyi/kafka-python | fb00adbd6c985df0780342c207598e01595cc9e2 | [
"Apache-2.0"
] | 20 | 2015-07-17T08:37:05.000Z | 2021-06-01T15:52:16.000Z | test/test_consumer.py | duruyi/kafka-python | fb00adbd6c985df0780342c207598e01595cc9e2 | [
"Apache-2.0"
] | 26 | 2015-07-09T20:16:23.000Z | 2020-04-03T22:00:38.000Z | test/test_consumer.py | duruyi/kafka-python | fb00adbd6c985df0780342c207598e01595cc9e2 | [
"Apache-2.0"
] | 14 | 2016-07-01T21:54:00.000Z | 2019-09-24T05:33:07.000Z | import sys
from mock import MagicMock, patch
from . import unittest
import pytest
from kafka import SimpleConsumer, KafkaConsumer, MultiProcessConsumer, OldKafkaConsumer
from kafka.errors import (
FailedPayloadsError, KafkaConfigurationError, NotLeaderForPartitionError,
UnknownTopicOrPartitionError)
from kafk... | 42.807453 | 149 | 0.663088 | import sys
from mock import MagicMock, patch
from . import unittest
import pytest
from kafka import SimpleConsumer, KafkaConsumer, MultiProcessConsumer, OldKafkaConsumer
from kafka.errors import (
FailedPayloadsError, KafkaConfigurationError, NotLeaderForPartitionError,
UnknownTopicOrPartitionError)
from kafk... | true | true |
1c03cba61a1a53258a45f75f1a72c8b648862bad | 8,415 | py | Python | gym/envs/madras/gym_madras.py | buridiaditya/gym | 99d4555e1862cb0bc88971fa6bc3402aa295b859 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/envs/madras/gym_madras.py | buridiaditya/gym | 99d4555e1862cb0bc88971fa6bc3402aa295b859 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/envs/madras/gym_madras.py | buridiaditya/gym | 99d4555e1862cb0bc88971fa6bc3402aa295b859 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | """
Gym Madras Env Wrapper.
This is an OpenAI gym environment wrapper for the MADRaS simulator. For more information on the OpenAI Gym interface, please refer to: https://gym.openai.com
Built on top of gym_torcs https://github.com/ugo-nama-kun/gym_torcs/blob/master/gym_torcs.py
The following enhancements were made f... | 40.456731 | 157 | 0.534403 |
import math
from copy import deepcopy
import numpy as np
from . import snakeoil3_gym as snakeoil3
from .gym_torcs import TorcsEnv
from .controllers.pid import PID
import os
import subprocess
import signal
import time
from mpi4py import MPI
import socket
class MadrasEnv(TorcsEnv):
def __init__(self, vision=False, ... | true | true |
1c03cbbaa38821b01ffbe6cc9051fbfb5ecf9d47 | 15,561 | py | Python | sdk/python/pulumi_azure_native/network/v20191201/network_interface_tap_configuration.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20191201/network_interface_tap_configuration.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20191201/network_interface_tap_configuration.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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 _utilities
fro... | 58.063433 | 3,796 | 0.710558 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['NetworkInterfaceTapConfigurationArgs', 'NetworkInterfaceTapConfiguration']
@pulumi.input_t... | true | true |
1c03cbdc4459660b1141efbc057da8b02789fad8 | 7,295 | py | Python | fill-in-the-blanks.py | benrodriguez9/python_myquiz | 8b58948b88acb6bf3c8ba3594ed0d2b00325be0a | [
"MIT"
] | 1 | 2016-04-06T03:37:46.000Z | 2016-04-06T03:37:46.000Z | fill-in-the-blanks.py | benrodriguez9/python_myquiz | 8b58948b88acb6bf3c8ba3594ed0d2b00325be0a | [
"MIT"
] | null | null | null | fill-in-the-blanks.py | benrodriguez9/python_myquiz | 8b58948b88acb6bf3c8ba3594ed0d2b00325be0a | [
"MIT"
] | null | null | null | # IPND Stage 2 Final Project
# Now you'll work on your own game to practice your skills and demonstrate what you've learned.
# For this project, you'll be building a Fill-in-the-Blanks quiz.
# Your quiz will prompt a user with a paragraph containing several blanks.
# The user should then be asked to fill in each blank... | 55.687023 | 605 | 0.721042 |
# Your quiz will prompt a user with a paragraph containing several blanks.
# The user should then be asked to fill in each blank appropriately to complete the paragraph.
# This can be used as a study tool to help you remember important vocabulary!
# Note: Your game will have to accept user input so, like the Mad Libs... | false | true |
1c03cc08c62eaed18b172ff3b9c3129095c0955e | 2,006 | py | Python | gram/migrations/0001_initial.py | monicaoyugi/User-profile | 941180648a72c3761c8df8a56c9498934808d735 | [
"MIT"
] | 4 | 2020-04-21T09:20:03.000Z | 2021-08-07T19:02:31.000Z | gram/migrations/0001_initial.py | monicaoyugi/User-profile | 941180648a72c3761c8df8a56c9498934808d735 | [
"MIT"
] | 6 | 2021-03-19T03:50:47.000Z | 2021-09-22T19:03:36.000Z | gram/migrations/0001_initial.py | monicaoyugi/User-profile | 941180648a72c3761c8df8a56c9498934808d735 | [
"MIT"
] | 3 | 2020-06-03T07:25:07.000Z | 2020-10-21T20:02:42.000Z | # Generated by Django 3.0.4 on 2020-04-03 10:59
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 42.680851 | 130 | 0.608674 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
1c03cc310e535371f7fba230d7579e7685eb63ae | 2,528 | py | Python | profiles_api/views.py | mzs9540/profiles-rest-api | 833d8f8dc9b6374e74e4dd50bd48de1c9216f139 | [
"MIT"
] | null | null | null | profiles_api/views.py | mzs9540/profiles-rest-api | 833d8f8dc9b6374e74e4dd50bd48de1c9216f139 | [
"MIT"
] | 5 | 2021-03-19T01:12:53.000Z | 2021-09-22T18:47:50.000Z | profiles_api/views.py | mzs9540/profiles-rest-api | 833d8f8dc9b6374e74e4dd50bd48de1c9216f139 | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status, viewsets
from profiles_api import serializers
class HelloApiView(APIView):
"""Test APi View"""
serializer_class = serializers.HelloSerializer
def get(self, request):
"""Return... | 32.410256 | 82 | 0.640823 | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status, viewsets
from profiles_api import serializers
class HelloApiView(APIView):
serializer_class = serializers.HelloSerializer
def get(self, request):
an_apiview = ["Hooooooooooooooooo... | true | true |
1c03ccdefb815d23bd080338f7d67d6f30b6858f | 1,462 | py | Python | scripts/shelltest.py | fromheten/plato-2020-ocaml | 5111735240a2adee73c82ee6bfae70314f3a166e | [
"Unlicense"
] | null | null | null | scripts/shelltest.py | fromheten/plato-2020-ocaml | 5111735240a2adee73c82ee6bfae70314f3a166e | [
"Unlicense"
] | null | null | null | scripts/shelltest.py | fromheten/plato-2020-ocaml | 5111735240a2adee73c82ee6bfae70314f3a166e | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import sys
import os
import json
import subprocess
test_dir = sys.argv.pop()
tests_files = os.listdir(test_dir)
def read_file(file_path):
text_file = open(file_path, "r")
data = text_file.read()
text_file.close()
return data
def read_files(tests_files):
tests = []
for... | 26.581818 | 113 | 0.606703 |
import sys
import os
import json
import subprocess
test_dir = sys.argv.pop()
tests_files = os.listdir(test_dir)
def read_file(file_path):
text_file = open(file_path, "r")
data = text_file.read()
text_file.close()
return data
def read_files(tests_files):
tests = []
for file in tests_files:
... | true | true |
1c03ccf7f4b635b9b26f78bffca4f9c5b61dea69 | 9,161 | py | Python | map_objects/game_map.py | BTmathic/game-template | 77765b1340e51828cc9216b4239f558c251859ce | [
"MIT"
] | 1 | 2019-09-01T20:15:52.000Z | 2019-09-01T20:15:52.000Z | map_objects/game_map.py | BTmathic/game-template | 77765b1340e51828cc9216b4239f558c251859ce | [
"MIT"
] | null | null | null | map_objects/game_map.py | BTmathic/game-template | 77765b1340e51828cc9216b4239f558c251859ce | [
"MIT"
] | null | null | null | from random import randint
import tcod as libtcod
from components.ai import BasicMonster
from components.equipment import EquipmentSlots
from components.equippable import Equippable
from components.fighter import Fighter
from components.item import Item
from components.stairs import Stairs
from entity import Entity
fr... | 47.221649 | 118 | 0.587163 | from random import randint
import tcod as libtcod
from components.ai import BasicMonster
from components.equipment import EquipmentSlots
from components.equippable import Equippable
from components.fighter import Fighter
from components.item import Item
from components.stairs import Stairs
from entity import Entity
fr... | true | true |
1c03cd78b1038530f5cd62a52b5559e566bd5323 | 350 | py | Python | src/panda_arm_motion_planning/scratch/dataset_formatter.py | rajathkmanjunath/Motion-Planning-Network | e53ee8c35b8349e78c5141d42670061f00a198d4 | [
"MIT"
] | 3 | 2020-04-13T03:43:30.000Z | 2021-11-03T09:08:17.000Z | src/panda_arm_motion_planning/scratch/dataset_formatter.py | rajathkmanjunath/Motion-Planning-Network | e53ee8c35b8349e78c5141d42670061f00a198d4 | [
"MIT"
] | null | null | null | src/panda_arm_motion_planning/scratch/dataset_formatter.py | rajathkmanjunath/Motion-Planning-Network | e53ee8c35b8349e78c5141d42670061f00a198d4 | [
"MIT"
] | 4 | 2021-09-16T06:06:56.000Z | 2021-11-10T08:45:34.000Z | import torch
from torch.utils.data import Dataset
class points_dataset(Dataset):
def __init__(self, list_IDs):
self.list_IDs = list_IDs
def __ len__(self):
return len(self.list_IDs)
def __getitem__(self, index):
ID = self.list_IDs[index]
x = torch.load(ws_location + 'point... | 25 | 56 | 0.648571 | import torch
from torch.utils.data import Dataset
class points_dataset(Dataset):
def __init__(self, list_IDs):
self.list_IDs = list_IDs
def __ len__(self):
return len(self.list_IDs)
def __getitem__(self, index):
ID = self.list_IDs[index]
x = torch.load(ws_location + 'point... | false | true |
1c03cf1e923b8e9885261b79fbcfb230414218d7 | 12,283 | py | Python | microutil/leica/leica.py | Hekstra-Lab/microutil | ab3b7b51754bf90ef35d6eea1c7b35cece638f0e | [
"BSD-3-Clause"
] | 2 | 2021-07-06T05:31:51.000Z | 2021-10-05T13:29:59.000Z | microutil/leica/leica.py | Hekstra-Lab/microutil | ab3b7b51754bf90ef35d6eea1c7b35cece638f0e | [
"BSD-3-Clause"
] | 16 | 2021-02-08T22:36:42.000Z | 2021-11-01T22:36:02.000Z | microutil/leica/leica.py | Hekstra-Lab/microutil | ab3b7b51754bf90ef35d6eea1c7b35cece638f0e | [
"BSD-3-Clause"
] | null | null | null | # flake8: noqa E741
import glob
import re
import xml.etree.ElementTree as ET
import dask.array as da
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tifffile as tiff
import xarray as xr
from cycler import cycler
__all__ = [
"delay_to_wns",
"get_standard_metadata",
"get_ldm_me... | 32.238845 | 106 | 0.621509 | import glob
import re
import xml.etree.ElementTree as ET
import dask.array as da
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tifffile as tiff
import xarray as xr
from cycler import cycler
__all__ = [
"delay_to_wns",
"get_standard_metadata",
"get_ldm_metadata",
"get_co... | true | true |
1c03d09d968e544dfd7bdb57f6ad5a102119ef2f | 593 | py | Python | Bot2/main.py | GustavoKristoffersen/Coronav-rus-Data-Twitter | ec7e6a5a2927416931ca5367c0686ef954872405 | [
"MIT"
] | null | null | null | Bot2/main.py | GustavoKristoffersen/Coronav-rus-Data-Twitter | ec7e6a5a2927416931ca5367c0686ef954872405 | [
"MIT"
] | null | null | null | Bot2/main.py | GustavoKristoffersen/Coronav-rus-Data-Twitter | ec7e6a5a2927416931ca5367c0686ef954872405 | [
"MIT"
] | 1 | 2020-12-19T04:45:44.000Z | 2020-12-19T04:45:44.000Z | import tweepy
import time
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
user = "1241503413281718272"
while True:
for tweet in tweepy.Curs... | 21.962963 | 66 | 0.640809 | import tweepy
import time
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
user = "1241503413281718272"
while True:
for tweet in tweepy.Curs... | true | true |
1c03d0f7b61f42905f192bb359236614b0799de6 | 1,052 | py | Python | tests/integrations/android_sdk/AndroidSDK/test_emulators.py | chuckyQ/briefcase | 06e84e7b1c3af016c828a5a640d277809de6644b | [
"BSD-3-Clause"
] | 917 | 2019-03-30T15:45:39.000Z | 2022-03-31T05:32:02.000Z | tests/integrations/android_sdk/AndroidSDK/test_emulators.py | CuPidev/briefcase | 35619cbe4b512c8521ad3733341e6bc3422efb58 | [
"BSD-3-Clause"
] | 429 | 2019-04-07T19:03:20.000Z | 2022-03-31T23:47:42.000Z | tests/integrations/android_sdk/AndroidSDK/test_emulators.py | CuPidev/briefcase | 35619cbe4b512c8521ad3733341e6bc3422efb58 | [
"BSD-3-Clause"
] | 166 | 2019-04-02T01:56:55.000Z | 2022-03-28T19:10:02.000Z | import subprocess
import pytest
from briefcase.exceptions import BriefcaseCommandError
def test_no_emulators(mock_sdk):
"If there are no emulators, an empty list is returned"
mock_sdk.command.subprocess.check_output.return_value = ''
assert mock_sdk.emulators() == []
def test_one_emulator(mock_sdk):
... | 28.432432 | 89 | 0.740494 | import subprocess
import pytest
from briefcase.exceptions import BriefcaseCommandError
def test_no_emulators(mock_sdk):
mock_sdk.command.subprocess.check_output.return_value = ''
assert mock_sdk.emulators() == []
def test_one_emulator(mock_sdk):
mock_sdk.command.subprocess.check_output.return_value =... | true | true |
1c03d1337c50b19235e428528d0e390c755d356a | 936 | py | Python | setup.py | nickzoic/nontemplate | 1767a6e403dc377ec1b7e06f0f36ac509c4a695f | [
"MIT"
] | 1 | 2015-12-15T19:50:00.000Z | 2015-12-15T19:50:00.000Z | setup.py | nickzoic/nontemplate | 1767a6e403dc377ec1b7e06f0f36ac509c4a695f | [
"MIT"
] | null | null | null | setup.py | nickzoic/nontemplate | 1767a6e403dc377ec1b7e06f0f36ac509c4a695f | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name = "nontemplate",
version = "0.12",
author = "Nick Moore",
author_email = "nick@zoic.org",
url = "http://code.zoic.org/nontemplate/",
description = "Nontemplate is not a Templating Language",
download_url = "http://code.zoic.org/nontemplate/dist/n... | 34.666667 | 83 | 0.616453 | from distutils.core import setup
setup(
name = "nontemplate",
version = "0.12",
author = "Nick Moore",
author_email = "nick@zoic.org",
url = "http://code.zoic.org/nontemplate/",
description = "Nontemplate is not a Templating Language",
download_url = "http://code.zoic.org/nontemplate/dist/n... | true | true |
1c03d1d0a72a6d330ae8d17a076fb36040732268 | 1,057 | py | Python | setup.py | dramis/pyebox | 0ac46ae5dc6fffd2f18f16ce94369a0809860392 | [
"Apache-2.0"
] | null | null | null | setup.py | dramis/pyebox | 0ac46ae5dc6fffd2f18f16ce94369a0809860392 | [
"Apache-2.0"
] | null | null | null | setup.py | dramis/pyebox | 0ac46ae5dc6fffd2f18f16ce94369a0809860392 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
install_requires = list(val.strip() for val in open('requirements.txt'))
tests_require = list(val.strip() for val in open('test_requirements.txt'))
setup(name='pyebox',
version='4.0.0',
description='Get your EBox consumption (wwww.ebox.ca)',
author='Charles Bergeron',
... | 33.03125 | 74 | 0.607379 | from setuptools import setup
install_requires = list(val.strip() for val in open('requirements.txt'))
tests_require = list(val.strip() for val in open('test_requirements.txt'))
setup(name='pyebox',
version='4.0.0',
description='Get your EBox consumption (wwww.ebox.ca)',
author='Charles Bergeron',
... | true | true |
1c03d2085fde3b669b443f352d44fe069d4fa0d6 | 1,457 | py | Python | mallenom/workcal/urls.py | crowmurk/mallenom | c85bba2e657965879e6fac18bb762ca739ff4d98 | [
"MIT"
] | null | null | null | mallenom/workcal/urls.py | crowmurk/mallenom | c85bba2e657965879e6fac18bb762ca739ff4d98 | [
"MIT"
] | 9 | 2020-02-12T01:04:30.000Z | 2022-02-10T09:22:09.000Z | mallenom/workcal/urls.py | crowmurk/mallenom | c85bba2e657965879e6fac18bb762ca739ff4d98 | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import permission_required
from django.urls import path, include
from . import views
app_name = 'workcal'
day_type = [
path('', views.DayTypeList.as_view(), name='list'),
path('create/', permission_required('is_superuser')(views.DayTypeCreate.as_view()), name='create'),
... | 40.472222 | 115 | 0.680165 | from django.contrib.auth.decorators import permission_required
from django.urls import path, include
from . import views
app_name = 'workcal'
day_type = [
path('', views.DayTypeList.as_view(), name='list'),
path('create/', permission_required('is_superuser')(views.DayTypeCreate.as_view()), name='create'),
... | true | true |
1c03d2827afff17e966c915cb995245d31e74f58 | 6,013 | py | Python | CAP-newCluster/reid/utils/clustering.py | ZoRoronoa/Camera-Aware-Proxy | 352f900bbae330f18c2bfe2b3f2516fb4e31adea | [
"Apache-2.0"
] | null | null | null | CAP-newCluster/reid/utils/clustering.py | ZoRoronoa/Camera-Aware-Proxy | 352f900bbae330f18c2bfe2b3f2516fb4e31adea | [
"Apache-2.0"
] | null | null | null | CAP-newCluster/reid/utils/clustering.py | ZoRoronoa/Camera-Aware-Proxy | 352f900bbae330f18c2bfe2b3f2516fb4e31adea | [
"Apache-2.0"
] | null | null | null | from re import U
from PIL.Image import new
import numpy
from numpy.lib.arraysetops import unique
import torch
from sklearn.cluster.dbscan_ import dbscan
import math
import faiss
from reid.utils.faiss_utils import search_index_pytorch, search_raw_array_pytorch, \
index_init_gpu, index_init_cp... | 41.184932 | 126 | 0.61866 | from re import U
from PIL.Image import new
import numpy
from numpy.lib.arraysetops import unique
import torch
from sklearn.cluster.dbscan_ import dbscan
import math
import faiss
from reid.utils.faiss_utils import search_index_pytorch, search_raw_array_pytorch, \
index_init_gpu, index_init_cp... | true | true |
1c03d33f8706ba604eeccd60a7194a2186652821 | 550 | py | Python | app/models/client.py | Maxcutex/pm_api | de1e1a07feecd1be7bb86a87b4ffed012a05aec0 | [
"MIT"
] | null | null | null | app/models/client.py | Maxcutex/pm_api | de1e1a07feecd1be7bb86a87b4ffed012a05aec0 | [
"MIT"
] | null | null | null | app/models/client.py | Maxcutex/pm_api | de1e1a07feecd1be7bb86a87b4ffed012a05aec0 | [
"MIT"
] | null | null | null | from .base_model import BaseModel, db
from ..utils.enums import ClientStatus
class Client(BaseModel):
__tablename__ = "clients"
institution_name = db.Column(db.String, nullable=False)
institution_url = db.Column(db.String, nullable=True)
institution_city = db.Column(db.String, nullable=False)
ins... | 36.666667 | 62 | 0.743636 | from .base_model import BaseModel, db
from ..utils.enums import ClientStatus
class Client(BaseModel):
__tablename__ = "clients"
institution_name = db.Column(db.String, nullable=False)
institution_url = db.Column(db.String, nullable=True)
institution_city = db.Column(db.String, nullable=False)
ins... | true | true |
1c03d3e274287de764d54721629c090fc5db3433 | 355 | py | Python | koapy/utils/logging/pyside2/QThreadLogging.py | resoliwan/koapy | b0616f252bb3588695dfb37c7d9b8580a65649a3 | [
"MIT"
] | 1 | 2021-09-25T22:33:01.000Z | 2021-09-25T22:33:01.000Z | koapy/utils/logging/pyside2/QThreadLogging.py | resoliwan/koapy | b0616f252bb3588695dfb37c7d9b8580a65649a3 | [
"MIT"
] | null | null | null | koapy/utils/logging/pyside2/QThreadLogging.py | resoliwan/koapy | b0616f252bb3588695dfb37c7d9b8580a65649a3 | [
"MIT"
] | 1 | 2021-11-12T15:33:29.000Z | 2021-11-12T15:33:29.000Z | from koapy.compat.pyside2.QtCore import QThread
from koapy.utils.logging.Logging import Logging
class QThreadLoggingMeta(type(Logging), type(QThread)):
pass
class QThreadLogging(QThread, Logging, metaclass=QThreadLoggingMeta):
def __init__(self, *args, **kwargs):
QThread.__init__(self, *args, **kwar... | 27.307692 | 69 | 0.743662 | from koapy.compat.pyside2.QtCore import QThread
from koapy.utils.logging.Logging import Logging
class QThreadLoggingMeta(type(Logging), type(QThread)):
pass
class QThreadLogging(QThread, Logging, metaclass=QThreadLoggingMeta):
def __init__(self, *args, **kwargs):
QThread.__init__(self, *args, **kwar... | true | true |
1c03d46f42a5ce7df12827a7bb0d873dbd60f6c7 | 25,005 | py | Python | nuscenes-devkit-master/python-sdk/nuscenes/utils/kitti.py | fpthink/V2B | 87561d5cd00ebf31326e8364167a787681ded367 | [
"MIT"
] | 19 | 2021-11-09T03:56:00.000Z | 2022-03-11T11:06:39.000Z | nuscenes-devkit-master/python-sdk/nuscenes/utils/kitti.py | fpthink/V2B | 87561d5cd00ebf31326e8364167a787681ded367 | [
"MIT"
] | 5 | 2021-11-12T02:49:40.000Z | 2022-03-06T02:41:31.000Z | nuscenes-devkit-master/python-sdk/nuscenes/utils/kitti.py | fpthink/V2B | 87561d5cd00ebf31326e8364167a787681ded367 | [
"MIT"
] | null | null | null | # nuScenes dev-kit.
# Code written by Alex Lang and Holger Caesar, 2019.
import os
from os import path as osp
from typing import List, Tuple, Any, Union
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
from matplotlib.axes import Axes
from pyquaternion import Quaternion
import sys
sys.path.app... | 44.178445 | 120 | 0.573245 |
import os
from os import path as osp
from typing import List, Tuple, Any, Union
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
from matplotlib.axes import Axes
from pyquaternion import Quaternion
import sys
sys.path.append("..")
from nuscenes import NuScenesExplorer
from utils.data_classes i... | true | true |
1c03d613911c5acaabc3f1e80d1231fe4c4009bf | 18,358 | py | Python | sklearn/manifold/_mds.py | matiasrvazquez/scikit-learn | e821a9e8a0d4ef63b1219faf9ab902ad0fd4b181 | [
"BSD-3-Clause"
] | 1 | 2022-03-13T05:37:00.000Z | 2022-03-13T05:37:00.000Z | sklearn/manifold/_mds.py | matiasrvazquez/scikit-learn | e821a9e8a0d4ef63b1219faf9ab902ad0fd4b181 | [
"BSD-3-Clause"
] | null | null | null | sklearn/manifold/_mds.py | matiasrvazquez/scikit-learn | e821a9e8a0d4ef63b1219faf9ab902ad0fd4b181 | [
"BSD-3-Clause"
] | null | null | null | """
Multi-dimensional Scaling (MDS).
"""
# author: Nelle Varoquaux <nelle.varoquaux@gmail.com>
# License: BSD
import numpy as np
from joblib import Parallel, effective_n_jobs
import warnings
from ..base import BaseEstimator
from ..metrics import euclidean_distances
from ..utils import check_random_state, check_arra... | 34.122677 | 85 | 0.632912 |
import numpy as np
from joblib import Parallel, effective_n_jobs
import warnings
from ..base import BaseEstimator
from ..metrics import euclidean_distances
from ..utils import check_random_state, check_array, check_symmetric
from ..isotonic import IsotonicRegression
from ..utils.fixes import delayed
def _smacof_s... | true | true |
1c03d6c3ca6867b3eda20490b92cadc2c74028e2 | 319 | py | Python | Desafio 41 (Categorias dos atletas).py | Danilo-Xaxa/python_curso_em_video | 9a88e5f579dfc844f936b7759d33e4068b091f09 | [
"MIT"
] | 4 | 2021-08-29T02:19:55.000Z | 2021-08-30T20:21:30.000Z | Desafio 41 (Categorias dos atletas).py | Danilo-Xaxa/python_curso_em_video | 9a88e5f579dfc844f936b7759d33e4068b091f09 | [
"MIT"
] | null | null | null | Desafio 41 (Categorias dos atletas).py | Danilo-Xaxa/python_curso_em_video | 9a88e5f579dfc844f936b7759d33e4068b091f09 | [
"MIT"
] | null | null | null | idade = int(input('Olá, atleta. Qual é a sua idade? '))
if idade < 9:
print('Você é um atleta mirim.')
elif idade < 14:
print('Você é um atleta infantil.')
elif idade < 19:
print('Você é um atleta júnior.')
elif idade < 20:
print('Você é um atleta sênior.')
else:
print('Você é um atleta master.')
| 24.538462 | 55 | 0.633229 | idade = int(input('Olá, atleta. Qual é a sua idade? '))
if idade < 9:
print('Você é um atleta mirim.')
elif idade < 14:
print('Você é um atleta infantil.')
elif idade < 19:
print('Você é um atleta júnior.')
elif idade < 20:
print('Você é um atleta sênior.')
else:
print('Você é um atleta master.')
| true | true |
1c03d8c0b60f477a71eaf20700feb7617375f6e1 | 1,983 | py | Python | tests/distributions/test_tensor_type.py | ashishfarmer/pyro | 54d48627a7c5c0575c2fe69d5b6c80f3c47b287b | [
"Apache-2.0"
] | 2 | 2020-06-05T20:40:50.000Z | 2020-09-05T15:39:48.000Z | tests/distributions/test_tensor_type.py | ashishfarmer/pyro | 54d48627a7c5c0575c2fe69d5b6c80f3c47b287b | [
"Apache-2.0"
] | null | null | null | tests/distributions/test_tensor_type.py | ashishfarmer/pyro | 54d48627a7c5c0575c2fe69d5b6c80f3c47b287b | [
"Apache-2.0"
] | 1 | 2020-06-04T18:25:38.000Z | 2020-06-04T18:25:38.000Z | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import pytest
import scipy.stats as sp
import torch
import pyro.distributions as dist
from tests.common import assert_equal, rocm_env
@pytest.fixture()
def test_data():
return torch.DoubleTensor([0.4])
@pytest.fixture()
de... | 26.797297 | 86 | 0.704992 |
import pytest
import scipy.stats as sp
import torch
import pyro.distributions as dist
from tests.common import assert_equal, rocm_env
@pytest.fixture()
def test_data():
return torch.DoubleTensor([0.4])
@pytest.fixture()
def alpha():
return torch.DoubleTensor([2.4])
@pytest.fixture()
def beta():
retu... | true | true |
1c03d943fada1fe31ba0f2e62aed8f978bd5d126 | 7,811 | py | Python | main.py | Litchichu/Deniable-Steganography | e39dc71b049b0051e6e16eee9a6eea55a526459b | [
"MIT"
] | null | null | null | main.py | Litchichu/Deniable-Steganography | e39dc71b049b0051e6e16eee9a6eea55a526459b | [
"MIT"
] | null | null | null | main.py | Litchichu/Deniable-Steganography | e39dc71b049b0051e6e16eee9a6eea55a526459b | [
"MIT"
] | null | null | null | import os
import pprint
import argparse
import torch
import pickle
import utils
import logging
import sys
from options import *
from model.hidden import Hidden
from noise_layers.noiser import Noiser
from noise_argparser import NoiseArgParser
from train import train
import torchsnooper
def main():
device = torch... | 52.422819 | 150 | 0.620919 | import os
import pprint
import argparse
import torch
import pickle
import utils
import logging
import sys
from options import *
from model.hidden import Hidden
from noise_layers.noiser import Noiser
from noise_argparser import NoiseArgParser
from train import train
import torchsnooper
def main():
device = torch... | true | true |
1c03d971c6ab0c9994d8f5ac7abf4a65059a2b4a | 4,866 | py | Python | contact_book.py | eri-purniawan/Contact-Book | daeb97a8c37924de84c323a15709204ef9609705 | [
"MIT"
] | null | null | null | contact_book.py | eri-purniawan/Contact-Book | daeb97a8c37924de84c323a15709204ef9609705 | [
"MIT"
] | null | null | null | contact_book.py | eri-purniawan/Contact-Book | daeb97a8c37924de84c323a15709204ef9609705 | [
"MIT"
] | null | null | null | import os
from typing import ValuesView
def add():
start = True
while start:
field = []
for i in range(3):
if i == 0:
field.append(str(input("Enter Name\t\t: ").title()))
if i == 1:
field.append(str(input("Enter Phone Number\t: ")))
if i == 2:
field.append(str(input("... | 21.248908 | 84 | 0.558159 | import os
from typing import ValuesView
def add():
start = True
while start:
field = []
for i in range(3):
if i == 0:
field.append(str(input("Enter Name\t\t: ").title()))
if i == 1:
field.append(str(input("Enter Phone Number\t: ")))
if i == 2:
field.append(str(input("... | true | true |
1c03dafde72f1f7d35460e7583e628daba28ed3f | 611 | py | Python | reviews/migrations/0007_review_client.py | chr0nu5/review-api | ec391c642334ef37eca565fbd6df30ef80a256d5 | [
"MIT"
] | null | null | null | reviews/migrations/0007_review_client.py | chr0nu5/review-api | ec391c642334ef37eca565fbd6df30ef80a256d5 | [
"MIT"
] | null | null | null | reviews/migrations/0007_review_client.py | chr0nu5/review-api | ec391c642334ef37eca565fbd6df30ef80a256d5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-20 06:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('oauth', '0003_auto_20161120_0428'),
('reviews', '00... | 25.458333 | 100 | 0.638298 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('oauth', '0003_auto_20161120_0428'),
('reviews', '0006_reviewer_client'),
]
operations = [
migrations.AddFie... | true | true |
1c03db44844f1ddbae06b7348cf90cf0cbbee364 | 1,420 | py | Python | authapi/migrations/0004_auto_20160523_1442.py | praekeltfoundation/seed-auth-api | 2238f7ecde2f75143bea0ac36f875793a19dde9b | [
"BSD-3-Clause"
] | null | null | null | authapi/migrations/0004_auto_20160523_1442.py | praekeltfoundation/seed-auth-api | 2238f7ecde2f75143bea0ac36f875793a19dde9b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T08:30:42.000Z | 2020-02-12T06:32:54.000Z | authapi/migrations/0004_auto_20160523_1442.py | praekeltfoundation/seed-auth-api | 2238f7ecde2f75143bea0ac36f875793a19dde9b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-23 14:42
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authapi', '0003_auto_20160520_1413'),
]
operations = [
migra... | 30.212766 | 91 | 0.592254 | from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authapi', '0003_auto_20160520_1413'),
]
operations = [
migrations.AddField(
model_name='seedpermission',
nam... | true | true |
1c03dd1f4a0eae002a485ec27ea54d2ae4043694 | 432 | py | Python | models/bilstm.py | chris4540/DT2119-Final-Project | a9e665d2fcc91442bcd80171fe557b09fcd71d00 | [
"MIT"
] | 1 | 2020-08-19T17:29:53.000Z | 2020-08-19T17:29:53.000Z | models/bilstm.py | chris4540/DT2119-Final-Project | a9e665d2fcc91442bcd80171fe557b09fcd71d00 | [
"MIT"
] | null | null | null | models/bilstm.py | chris4540/DT2119-Final-Project | a9e665d2fcc91442bcd80171fe557b09fcd71d00 | [
"MIT"
] | null | null | null | from .lstm import LSTMClassifier
import torch.nn as nn
class BiLSTMClassifier(LSTMClassifier):
def __init__(self, n_feature, n_class, n_hidden=3, num_layers=1):
super().__init__(n_feature, n_class, n_hidden, num_layers)
self.lstm = nn.LSTM(input_size=n_feature, hidden_size=n_hidden,
... | 48 | 71 | 0.706019 | from .lstm import LSTMClassifier
import torch.nn as nn
class BiLSTMClassifier(LSTMClassifier):
def __init__(self, n_feature, n_class, n_hidden=3, num_layers=1):
super().__init__(n_feature, n_class, n_hidden, num_layers)
self.lstm = nn.LSTM(input_size=n_feature, hidden_size=n_hidden,
... | true | true |
1c03dd70425c5bb9604cd7aedfe3dbb146d3ebb4 | 69,289 | py | Python | test/test_endpoints.py | meejah/txtorcon | 7da6ad6f91c395951be1b4e7e1011baa2f7a689f | [
"MIT"
] | 180 | 2015-01-12T23:57:06.000Z | 2022-03-17T00:24:35.000Z | test/test_endpoints.py | meejah/txtorcon | 7da6ad6f91c395951be1b4e7e1011baa2f7a689f | [
"MIT"
] | 262 | 2015-01-16T21:14:50.000Z | 2022-02-25T01:33:42.000Z | test/test_endpoints.py | meejah/txtorcon | 7da6ad6f91c395951be1b4e7e1011baa2f7a689f | [
"MIT"
] | 61 | 2015-01-05T01:10:57.000Z | 2022-01-04T08:13:39.000Z | from __future__ import print_function
import os
import sys
from mock import patch
from mock import Mock, MagicMock
from unittest import skipIf
from binascii import b2a_base64
from zope.interface import implementer, directlyProvides
from twisted.trial import unittest
from twisted.test import proto_helpers
from twiste... | 36.602747 | 259 | 0.607095 | from __future__ import print_function
import os
import sys
from mock import patch
from mock import Mock, MagicMock
from unittest import skipIf
from binascii import b2a_base64
from zope.interface import implementer, directlyProvides
from twisted.trial import unittest
from twisted.test import proto_helpers
from twiste... | true | true |
1c03dd9740db69eecc34adb2cdf507a791b228fe | 38,979 | py | Python | collections/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py | pbouffetps/FlashArray-Collection | 2dc79ae83e4867be180aec29b96cf492b0c242c3 | [
"BSD-2-Clause"
] | null | null | null | collections/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py | pbouffetps/FlashArray-Collection | 2dc79ae83e4867be180aec29b96cf492b0c242c3 | [
"BSD-2-Clause"
] | null | null | null | collections/ansible_collections/purestorage/flasharray/plugins/modules/purefa_info.py | pbouffetps/FlashArray-Collection | 2dc79ae83e4867be180aec29b96cf492b0c242c3 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2019, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | 38.402956 | 119 | 0.554581 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: purefa_info
version_added: '2.9'
short_description: Collec... | true | true |
1c03ddb61e4348f72512216f9719b2e8a7b185bc | 94 | py | Python | src/occurrence_project/occurrence_api/admin.py | anapcruz/Ubiwhere_Challenge | f1066317c70670d12897475ef0051c033056c98e | [
"MIT"
] | null | null | null | src/occurrence_project/occurrence_api/admin.py | anapcruz/Ubiwhere_Challenge | f1066317c70670d12897475ef0051c033056c98e | [
"MIT"
] | null | null | null | src/occurrence_project/occurrence_api/admin.py | anapcruz/Ubiwhere_Challenge | f1066317c70670d12897475ef0051c033056c98e | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
admin.site.register(models.Occurrence) | 18.8 | 38 | 0.819149 | from django.contrib import admin
from . import models
admin.site.register(models.Occurrence) | true | true |
1c03df0d77a97f2b6a2d3d79798d14c114a7608a | 2,400 | py | Python | official/utils/logging/hooks_helper_test.py | jieming2002/models-quiz8 | 421dc407a10444cab4bd88c25599077acca96bdb | [
"Apache-2.0"
] | 2 | 2018-07-05T18:52:53.000Z | 2018-07-05T18:54:14.000Z | official/utils/logging/hooks_helper_test.py | jieming2002/models-quiz8 | 421dc407a10444cab4bd88c25599077acca96bdb | [
"Apache-2.0"
] | null | null | null | official/utils/logging/hooks_helper_test.py | jieming2002/models-quiz8 | 421dc407a10444cab4bd88c25599077acca96bdb | [
"Apache-2.0"
] | 1 | 2019-07-21T13:18:03.000Z | 2019-07-21T13:18:03.000Z | # Copyright 2017 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... | 36.923077 | 80 | 0.720833 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import unittest
import tensorflow as tf
from official.utils.logging import hooks_helper
class BaseTest(unittest.TestCase):
def test_raise_in_non_list_names(self):
with self.assertRaises(ValueError... | true | true |
1c03df67bfb538ced12b1fce4fde613c31868ffb | 1,614 | py | Python | sockets/chatroom-sentdex/client.py | Mastermind-sap/Python-Sockets | c6f80631f101aa7e3efea23c8a61f7f08f0810a7 | [
"MIT"
] | 1 | 2020-11-10T06:33:50.000Z | 2020-11-10T06:33:50.000Z | sockets/chatroom-sentdex/client.py | Mastermind-sap/Python-Sockets | c6f80631f101aa7e3efea23c8a61f7f08f0810a7 | [
"MIT"
] | null | null | null | sockets/chatroom-sentdex/client.py | Mastermind-sap/Python-Sockets | c6f80631f101aa7e3efea23c8a61f7f08f0810a7 | [
"MIT"
] | null | null | null | import socket
import select
import errno
import sys
HEADER_LENGTH=10
##IP="127.0.0.1"
IP="192.168.29.37"
PORT=1234
my_username=input("Username: ")
client_socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
client_socket.connect((IP,PORT))
client_socket.setblocking(False)
username=my_username.enc... | 31.038462 | 75 | 0.63197 | import socket
import select
import errno
import sys
HEADER_LENGTH=10
IP="192.168.29.37"
PORT=1234
my_username=input("Username: ")
client_socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
client_socket.connect((IP,PORT))
client_socket.setblocking(False)
username=my_username.encode("utf-8")
user... | true | true |
1c03dffa1fce987d55f62497a2a2aaf8ec93c757 | 3,100 | py | Python | netket/legacy/machine/density_matrix/rbm.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | null | null | null | netket/legacy/machine/density_matrix/rbm.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | 11 | 2021-07-12T15:20:14.000Z | 2022-01-17T09:40:41.000Z | netket/legacy/machine/density_matrix/rbm.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | 1 | 2021-04-25T15:47:32.000Z | 2021-04-25T15:47:32.000Z | from . import AbstractDensityMatrix
from .. import RbmSpin as PureRbmSpin
import numpy as _np
class RbmSpin(AbstractDensityMatrix):
def __init__(
self,
hilbert,
n_hidden=None,
alpha=None,
use_visible_bias=True,
use_hidden_bias=True,
automorphisms=None,
... | 36.046512 | 106 | 0.583226 | from . import AbstractDensityMatrix
from .. import RbmSpin as PureRbmSpin
import numpy as _np
class RbmSpin(AbstractDensityMatrix):
def __init__(
self,
hilbert,
n_hidden=None,
alpha=None,
use_visible_bias=True,
use_hidden_bias=True,
automorphisms=None,
... | true | true |
1c03e022d07c15e81d63ffc4035a83cf330e5259 | 7,870 | py | Python | checkov/terraform/runner.py | raghavkaul/checkov | 7a87e49907d517b3a0767823e33d3f2352299695 | [
"Apache-2.0"
] | null | null | null | checkov/terraform/runner.py | raghavkaul/checkov | 7a87e49907d517b3a0767823e33d3f2352299695 | [
"Apache-2.0"
] | null | null | null | checkov/terraform/runner.py | raghavkaul/checkov | 7a87e49907d517b3a0767823e33d3f2352299695 | [
"Apache-2.0"
] | null | null | null | import dataclasses
import logging
import os
from typing import Dict
import dpath.util
from checkov.common.output.record import Record
from checkov.common.output.report import Report
from checkov.common.util import dict_utils
from checkov.common.runners.base_runner import BaseRunner
from checkov.common.variables.conte... | 49.496855 | 133 | 0.657433 | import dataclasses
import logging
import os
from typing import Dict
import dpath.util
from checkov.common.output.record import Record
from checkov.common.output.report import Report
from checkov.common.util import dict_utils
from checkov.common.runners.base_runner import BaseRunner
from checkov.common.variables.conte... | true | true |
1c03e06e39116a68ba2ab23abadb0e027b8c9875 | 546 | py | Python | packages/python/plotly/plotly/validators/choroplethmapbox/colorbar/_thicknessmode.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/choroplethmapbox/colorbar/_thicknessmode.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/choroplethmapbox/colorbar/_thicknessmode.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="thicknessmode",
parent_name="choroplethmapbox.colorbar",
**kwargs,
):
super(ThicknessmodeValidator, self).__init__(
... | 30.333333 | 79 | 0.6337 | import _plotly_utils.basevalidators
class ThicknessmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="thicknessmode",
parent_name="choroplethmapbox.colorbar",
**kwargs,
):
super(ThicknessmodeValidator, self).__init__(
... | true | true |
1c03e18b255c140cd58f488db2db089178001568 | 2,061 | py | Python | defender/test_settings.py | sallyruthstruik/django-defender | 6c233213551fe290d7894d9365b8c5a19f016767 | [
"Apache-2.0"
] | null | null | null | defender/test_settings.py | sallyruthstruik/django-defender | 6c233213551fe290d7894d9365b8c5a19f016767 | [
"Apache-2.0"
] | null | null | null | defender/test_settings.py | sallyruthstruik/django-defender | 6c233213551fe290d7894d9365b8c5a19f016767 | [
"Apache-2.0"
] | 1 | 2019-11-21T09:39:21.000Z | 2019-11-21T09:39:21.000Z | import os
from celery import Celery
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
SITE_ID = 1
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.a... | 27.118421 | 73 | 0.688986 | import os
from celery import Celery
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
SITE_ID = 1
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.a... | true | true |
1c03e18bbfa36f9eec4432d0271e8261bb6654a8 | 364 | py | Python | tests/sentry/web/frontend/test_error_404.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | tests/sentry/web/frontend/test_error_404.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/web/frontend/test_error_404.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.testutils import TestCase
class Error404Test(TestCase):
urls = "sentry.conf.urls"
def test_renders(self):
resp = self.client.get(reverse("error-404"))
assert resp.status_code == 404
self.... | 24.266667 | 56 | 0.725275 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.testutils import TestCase
class Error404Test(TestCase):
urls = "sentry.conf.urls"
def test_renders(self):
resp = self.client.get(reverse("error-404"))
assert resp.status_code == 404
self.... | true | true |
1c03e1db2dc7eed5b7f745f450b0902af2b1ed56 | 23,860 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/operations/availability_sets_operations.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 47.247525 | 188 | 0.667477 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class AvailabilitySetsOperations(object):
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize... | true | true |
1c03e208a55ec88d0596e3daf0c7e61e66872eae | 17,309 | py | Python | source/BattlesnakeGym/battlesnake_gym/snake.py | rostoker/sagemaker-battlesnake-ai | 789036399cfdc034d8b79c00feec134834476a9b | [
"Apache-2.0"
] | null | null | null | source/BattlesnakeGym/battlesnake_gym/snake.py | rostoker/sagemaker-battlesnake-ai | 789036399cfdc034d8b79c00feec134834476a9b | [
"Apache-2.0"
] | 5 | 2021-04-30T21:33:46.000Z | 2022-02-10T02:26:50.000Z | source/BattlesnakeGym/battlesnake_gym/snake.py | rostoker/sagemaker-battlesnake-ai | 789036399cfdc034d8b79c00feec134834476a9b | [
"Apache-2.0"
] | 1 | 2020-12-14T14:49:25.000Z | 2020-12-14T14:49:25.000Z | # Copyright Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" ... | 34.005894 | 112 | 0.585014 |
import numpy as np
from .utils import get_random_coordinates
class Snake:
UP = 0
DOWN = 1
LEFT = 2
RIGHT = 3
FULL_HEALTH = 100
def __init__(self, starting_position, map_size):
self.health = self.FULL_HEALTH
self.locations = [] self.locations.append(starting_posi... | true | true |
1c03e2334fe599661519081c4a1c7975b3b9ef2d | 35,806 | py | Python | homeassistant/helpers/entity.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 1,635 | 2015-01-01T14:59:18.000Z | 2016-04-13T02:36:16.000Z | homeassistant/helpers/entity.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 1,463 | 2015-01-06T06:18:07.000Z | 2016-04-12T22:30:37.000Z | homeassistant/helpers/entity.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 659 | 2015-01-05T14:02:23.000Z | 2016-04-12T23:39:31.000Z | """An abstract class for entities."""
from __future__ import annotations
from abc import ABC
import asyncio
from collections.abc import Coroutine, Iterable, Mapping, MutableMapping
from dataclasses import dataclass
from datetime import datetime, timedelta
from enum import Enum, auto
import functools as ft
import loggi... | 34.231358 | 133 | 0.642909 | from __future__ import annotations
from abc import ABC
import asyncio
from collections.abc import Coroutine, Iterable, Mapping, MutableMapping
from dataclasses import dataclass
from datetime import datetime, timedelta
from enum import Enum, auto
import functools as ft
import logging
import math
import sys
from timeit ... | true | true |
1c03e23a7e47001e361be83043fde1325cd5746a | 1,755 | py | Python | app.py | alwaysai/object-detector | 7fb5384e5e00073dfc9bb7d94c6bb4f7f62be330 | [
"Apache-2.0"
] | 1 | 2021-06-08T19:03:31.000Z | 2021-06-08T19:03:31.000Z | app.py | alwaysai/object-detector | 7fb5384e5e00073dfc9bb7d94c6bb4f7f62be330 | [
"Apache-2.0"
] | null | null | null | app.py | alwaysai/object-detector | 7fb5384e5e00073dfc9bb7d94c6bb4f7f62be330 | [
"Apache-2.0"
] | null | null | null | import time
import edgeiq
def main():
obj_detect = edgeiq.ObjectDetection("alwaysai/mobilenet_ssd")
obj_detect.load(engine=edgeiq.Engine.DNN)
print("Loaded model:\n{}\n".format(obj_detect.model_id))
print("Engine: {}".format(obj_detect.engine))
print("Accelerator: {}\n".format(obj_detect.accelera... | 30.789474 | 79 | 0.553276 | import time
import edgeiq
def main():
obj_detect = edgeiq.ObjectDetection("alwaysai/mobilenet_ssd")
obj_detect.load(engine=edgeiq.Engine.DNN)
print("Loaded model:\n{}\n".format(obj_detect.model_id))
print("Engine: {}".format(obj_detect.engine))
print("Accelerator: {}\n".format(obj_detect.accelera... | true | true |
1c03e3c2ec0cd54403f25c668fc0c48e5737172b | 8,160 | py | Python | plottr/apps/ui/monitr.py | koubitlabuiuc/plottr | c4c31a13fb7f2cf86abda1df26f67380fdcaa72b | [
"MIT"
] | 19 | 2020-10-20T15:45:02.000Z | 2022-03-15T06:39:44.000Z | plottr/apps/ui/monitr.py | koubitlabuiuc/plottr | c4c31a13fb7f2cf86abda1df26f67380fdcaa72b | [
"MIT"
] | 103 | 2020-04-17T15:18:50.000Z | 2022-03-28T14:18:15.000Z | plottr/apps/ui/monitr.py | koubitlabuiuc/plottr | c4c31a13fb7f2cf86abda1df26f67380fdcaa72b | [
"MIT"
] | 22 | 2020-04-17T12:52:49.000Z | 2022-02-15T21:21:44.000Z | import os
from enum import Enum
from typing import List, Any, Optional, Dict, Sequence, Union
from pprint import pprint
from plottr import QtCore, QtGui, QtWidgets, Slot, Signal
from plottr.data.datadict import DataDict
def findFilesByExtension(path: str, extensions: Sequence[str]) -> List[str]:
ret: List[str] =... | 35.324675 | 137 | 0.588235 | import os
from enum import Enum
from typing import List, Any, Optional, Dict, Sequence, Union
from pprint import pprint
from plottr import QtCore, QtGui, QtWidgets, Slot, Signal
from plottr.data.datadict import DataDict
def findFilesByExtension(path: str, extensions: Sequence[str]) -> List[str]:
ret: List[str] =... | true | true |
1c03e4f1a90c17b65d582f25fd970b5c1ea50350 | 41,910 | py | Python | theano/gpuarray/tests/test_dnn.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 64 | 2016-10-02T20:41:56.000Z | 2020-03-11T14:59:40.000Z | theano/gpuarray/tests/test_dnn.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 4 | 2017-06-12T05:12:38.000Z | 2018-03-15T03:16:30.000Z | theano/gpuarray/tests/test_dnn.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 30 | 2016-10-27T21:59:00.000Z | 2021-02-20T09:55:14.000Z | from __future__ import absolute_import, print_function, division
import logging
from nose.plugins.skip import SkipTest
from nose_parameterized import parameterized
import numpy
from itertools import product, chain
import theano
from six import StringIO
import theano.tensor as T
import theano.tests.unittest_tools as u... | 37.520143 | 104 | 0.528084 | from __future__ import absolute_import, print_function, division
import logging
from nose.plugins.skip import SkipTest
from nose_parameterized import parameterized
import numpy
from itertools import product, chain
import theano
from six import StringIO
import theano.tensor as T
import theano.tests.unittest_tools as u... | true | true |
1c03e5b1937b24240e10a556ec3658ca89e78e05 | 19,640 | py | Python | ffai/util/bothelper.py | tysen2k/ffai | 2fa1fd45a8877986fdb21e3fea5e01cbf819d3ec | [
"Apache-2.0"
] | null | null | null | ffai/util/bothelper.py | tysen2k/ffai | 2fa1fd45a8877986fdb21e3fea5e01cbf819d3ec | [
"Apache-2.0"
] | null | null | null | ffai/util/bothelper.py | tysen2k/ffai | 2fa1fd45a8877986fdb21e3fea5e01cbf819d3ec | [
"Apache-2.0"
] | null | null | null | """
A number of static methods for interpretting the state of the fantasy football pitch that aren't required directly by
the client
"""
from ffai.core import Game, Action, ActionType
from ffai.core.procedure import *
from ffai.util.pathfinding import *
from typing import Optional, List, Dict
class ActionSequence:
... | 39.676768 | 253 | 0.667668 | from ffai.core import Game, Action, ActionType
from ffai.core.procedure import *
from ffai.util.pathfinding import *
from typing import Optional, List, Dict
class ActionSequence:
def __init__(self, action_steps: List[Action], score: float = 0, description: str = ''):
self.action... | true | true |
1c03e6d2d68d7cc9225f5efa2f9ff28fcb4e3fd6 | 8,010 | py | Python | purity_fb/purity_fb_1dot10/models/certificate_post.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot10/models/certificate_post.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot10/models/certificate_post.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.10 Python SDK
Pure Storage FlashBlade REST 1.10 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.10
Contact... | 30.112782 | 287 | 0.612609 |
from pprint import pformat
from six import iteritems
import re
class CertificatePost(object):
swagger_types = {
'name': 'str',
'certificate': 'str',
'certificate_type': 'str',
'intermediate_certificate': 'str',
'passphrase': 'str',
'private_key': 'str'
}
... | true | true |
1c03e7968fce9c017858494db3c9e30f8b1cc3f8 | 23,710 | py | Python | ignite/contrib/handlers/neptune_logger.py | devrimcavusoglu/ignite | f51ef0c299511399639c15e9735a78cb6b60db97 | [
"BSD-3-Clause"
] | null | null | null | ignite/contrib/handlers/neptune_logger.py | devrimcavusoglu/ignite | f51ef0c299511399639c15e9735a78cb6b60db97 | [
"BSD-3-Clause"
] | null | null | null | ignite/contrib/handlers/neptune_logger.py | devrimcavusoglu/ignite | f51ef0c299511399639c15e9735a78cb6b60db97 | [
"BSD-3-Clause"
] | null | null | null | """Neptune logger and its helper handlers."""
import tempfile
from typing import Any, Callable, List, Mapping, Optional, Union
import torch
import torch.nn as nn
from torch.optim import Optimizer
import ignite.distributed as idist
from ignite.contrib.handlers.base_logger import (
BaseLogger,
BaseOptimizerPara... | 40.529915 | 119 | 0.6248 | import tempfile
from typing import Any, Callable, List, Mapping, Optional, Union
import torch
import torch.nn as nn
from torch.optim import Optimizer
import ignite.distributed as idist
from ignite.contrib.handlers.base_logger import (
BaseLogger,
BaseOptimizerParamsHandler,
BaseOutputHandler,
BaseWeig... | true | true |
1c03e7c18aa52fa6cfc51f3d8c5a795ab6844dac | 1,507 | py | Python | tests/core/test_persistable_store.py | StackVista/sts-agent | f8358ea46820ffb9eb0b4b30c7d7457cc2cc987a | [
"BSD-3-Clause"
] | 4 | 2017-03-18T12:16:40.000Z | 2020-11-12T06:59:29.000Z | tests/core/test_persistable_store.py | StackVista/sts-agent | f8358ea46820ffb9eb0b4b30c7d7457cc2cc987a | [
"BSD-3-Clause"
] | 18 | 2016-09-22T08:01:02.000Z | 2020-07-15T08:30:17.000Z | tests/core/test_persistable_store.py | StackVista/sts-agent | f8358ea46820ffb9eb0b4b30c7d7457cc2cc987a | [
"BSD-3-Clause"
] | 8 | 2016-11-23T06:55:51.000Z | 2021-07-05T05:12:34.000Z | from utils.persistable_store import PersistableStore
from unittest import TestCase
import uuid
class TestPersistableStore(TestCase):
def test_create_store(self):
check_name = str(uuid.uuid4())
test_object = {'test': 42.0}
store = PersistableStore(check_name, "instanceid")
store.loa... | 33.488889 | 58 | 0.652289 | from utils.persistable_store import PersistableStore
from unittest import TestCase
import uuid
class TestPersistableStore(TestCase):
def test_create_store(self):
check_name = str(uuid.uuid4())
test_object = {'test': 42.0}
store = PersistableStore(check_name, "instanceid")
store.loa... | true | true |
1c03e87b8173b11fe18557bb48089b4fe9378f92 | 27,029 | py | Python | metaflow/main_cli.py | celsiustx/metaflow | 53b72aac978c429ced680ebbd222c1056425ad9c | [
"Apache-2.0"
] | 1 | 2022-01-07T22:32:27.000Z | 2022-01-07T22:32:27.000Z | metaflow/main_cli.py | celsiustx/metaflow | 53b72aac978c429ced680ebbd222c1056425ad9c | [
"Apache-2.0"
] | null | null | null | metaflow/main_cli.py | celsiustx/metaflow | 53b72aac978c429ced680ebbd222c1056425ad9c | [
"Apache-2.0"
] | null | null | null | import click
import json
import os
import shutil
import sys
from os.path import expanduser
from metaflow.datastore.local import LocalDataStore
from metaflow.flowspec import FlowSpec
from metaflow.metaflow_config import DATASTORE_LOCAL_DIR
from metaflow.util import to_unicode
def makedirs(path):
# This is for py... | 42.565354 | 96 | 0.546672 | import click
import json
import os
import shutil
import sys
from os.path import expanduser
from metaflow.datastore.local import LocalDataStore
from metaflow.flowspec import FlowSpec
from metaflow.metaflow_config import DATASTORE_LOCAL_DIR
from metaflow.util import to_unicode
def makedirs(path):
try:
... | true | true |
1c03e912e1e8c6b6fd4d31b0ea4cefa85a9ebd4d | 4,427 | py | Python | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py | yugangw-msft/AutoRest | 32775a902b522e5e7fda9debb8dfc1d40cfb6de0 | [
"MIT"
] | null | null | null | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py | yugangw-msft/AutoRest | 32775a902b522e5e7fda9debb8dfc1d40cfb6de0 | [
"MIT"
] | null | null | null | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/auto_rest_complex_test_service.py | yugangw-msft/AutoRest | 32775a902b522e5e7fda9debb8dfc1d40cfb6de0 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 42.980583 | 89 | 0.732324 |
from msrest.service_client import ServiceClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from .operations.basic_operations import BasicOperations
from .operations.primitive_operations import PrimitiveOperations
from .operations.array_operations import ArrayOperations
from... | true | true |
1c03e92ebf814f7ccfcf99ff6f59aa638921c32c | 1,045 | py | Python | sitePjt/posting/migrations/0010_auto_20200403_0011.py | returnturn/200OK | a60dbb43141210cc0950cc2e7490af1fd98b2ec0 | [
"Apache-2.0"
] | null | null | null | sitePjt/posting/migrations/0010_auto_20200403_0011.py | returnturn/200OK | a60dbb43141210cc0950cc2e7490af1fd98b2ec0 | [
"Apache-2.0"
] | 50 | 2020-02-18T18:36:39.000Z | 2022-03-12T00:23:05.000Z | sitePjt/posting/migrations/0010_auto_20200403_0011.py | returnturn/200OK | a60dbb43141210cc0950cc2e7490af1fd98b2ec0 | [
"Apache-2.0"
] | 8 | 2020-02-04T01:29:55.000Z | 2020-04-09T04:12:41.000Z | # Generated by Django 2.2.2 on 2020-04-03 06:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posting', '0009_auto_20200403_0001'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='contentTyp... | 36.034483 | 254 | 0.593301 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posting', '0009_auto_20200403_0001'),
]
operations = [
migrations.AlterField(
model_name='comment',
name='contentType',
field=models.CharField(choices=[... | true | true |
1c03eaec70dedbaa38d538e69fa5399e5e940d7f | 2,826 | py | Python | tests/intersim/envs/test_simulator.py | sisl/InteractionSimulator | a4f68349eb7fa55ed5855a94bb97d8242869149d | [
"MIT"
] | 3 | 2021-07-13T07:28:34.000Z | 2021-07-29T12:37:20.000Z | tests/intersim/envs/test_simulator.py | sisl/InteractionSimulator | a4f68349eb7fa55ed5855a94bb97d8242869149d | [
"MIT"
] | 6 | 2021-08-30T15:51:19.000Z | 2022-02-21T12:39:08.000Z | tests/intersim/envs/test_simulator.py | sisl/InteractionSimulator | a4f68349eb7fa55ed5855a94bb97d8242869149d | [
"MIT"
] | 1 | 2021-08-29T20:28:54.000Z | 2021-08-29T20:28:54.000Z | import gym
from intersim.utils import LOCATIONS, MAX_TRACKS, df_to_stackedvehicletraj
from intersim.graphs import ConeVisibilityGraph
import torch
cvg = ConeVisibilityGraph(r=20, half_angle=120)
env = gym.make('intersim:intersim-v0', graph=cvg)
env2 = gym.make('intersim:intersim-v0', graph=cvg, mask_relstate=True)
d... | 34.048193 | 116 | 0.668082 | import gym
from intersim.utils import LOCATIONS, MAX_TRACKS, df_to_stackedvehicletraj
from intersim.graphs import ConeVisibilityGraph
import torch
cvg = ConeVisibilityGraph(r=20, half_angle=120)
env = gym.make('intersim:intersim-v0', graph=cvg)
env2 = gym.make('intersim:intersim-v0', graph=cvg, mask_relstate=True)
d... | true | true |
1c03ebd1553ef84fcd66e6bfe0a08c954b78fa43 | 2,613 | py | Python | ai/exercices/day01/blood_model.py | PoCFrance/Pool2019 | b043a2a06886d72d51d829942a657145020afcf7 | [
"MIT"
] | 7 | 2019-05-09T14:45:03.000Z | 2020-06-29T23:21:25.000Z | ai/exercices/day01/blood_model.py | PoCInnovation/Pool2019 | b043a2a06886d72d51d829942a657145020afcf7 | [
"MIT"
] | null | null | null | ai/exercices/day01/blood_model.py | PoCInnovation/Pool2019 | b043a2a06886d72d51d829942a657145020afcf7 | [
"MIT"
] | null | null | null | import csv
import numpy as np
import random
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
PARAM_MIN_INIT = -1.0
PARAM_MAX_INIT = 1.0
LEARNING_RATE = 0.001
MU = 0.57 # Limit of loss (when the loss become lower than MU, we can stop the training)
# Normalize numpy array
def normalize(x):
... | 29.693182 | 109 | 0.656716 | import csv
import numpy as np
import random
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
PARAM_MIN_INIT = -1.0
PARAM_MAX_INIT = 1.0
LEARNING_RATE = 0.001
MU = 0.57
def normalize(x):
return (x - x.mean() / x.std())
def unormalize(x, mean, std):
return (x * x.std() + x.mean())
de... | true | true |
1c03ed6427295314035936f0d2c08a2a07a2f90b | 54,550 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py | kazrael2119/azure-sdk-for-python | 485dd7b1b5ac41c1a5b9991e402b4035b55f437a | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py | kazrael2119/azure-sdk-for-python | 485dd7b1b5ac41c1a5b9991e402b4035b55f437a | [
"MIT"
] | null | null | null | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/operations/_managed_clusters_operations.py | kazrael2119/azure-sdk-for-python | 485dd7b1b5ac41c1a5b9991e402b4035b55f437a | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.307301 | 598 | 0.682438 | import functools
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
f... | true | true |
1c03edc23a1cfa1eb1f304c86a2a773a76b99db4 | 38,771 | py | Python | numpyro/infer/hmc_gibbs.py | gustavehug/numpyro | bd93d45ee6a273d42e77426445ce695fa8c43135 | [
"Apache-2.0"
] | null | null | null | numpyro/infer/hmc_gibbs.py | gustavehug/numpyro | bd93d45ee6a273d42e77426445ce695fa8c43135 | [
"Apache-2.0"
] | null | null | null | numpyro/infer/hmc_gibbs.py | gustavehug/numpyro | bd93d45ee6a273d42e77426445ce695fa8c43135 | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from collections import defaultdict, namedtuple
import copy
from functools import partial
import warnings
import numpy as np
from jax import (
device_put,
grad,
hessian,
jacfwd,
jacobian,
lax,
ops,
ran... | 39.643149 | 113 | 0.618581 |
from collections import defaultdict, namedtuple
import copy
from functools import partial
import warnings
import numpy as np
from jax import (
device_put,
grad,
hessian,
jacfwd,
jacobian,
lax,
ops,
random,
value_and_grad,
)
import jax.numpy as jnp
from jax.scipy.special import exp... | true | true |
1c03ef927cb50058385e9782cf7ddd830f28654f | 4,055 | py | Python | code/v1/src/run.py | aister2020/KDDCUP_2020_MultimodalitiesRecall_3st_Place | 508c263e72184e28ad6c5eadf637095761e5e035 | [
"Apache-2.0"
] | 11 | 2020-07-20T12:53:44.000Z | 2021-07-16T08:42:45.000Z | code/v1/src/run.py | aister2020/KDDCUP_2020_MultimodalitiesRecall_3st_Place | 508c263e72184e28ad6c5eadf637095761e5e035 | [
"Apache-2.0"
] | null | null | null | code/v1/src/run.py | aister2020/KDDCUP_2020_MultimodalitiesRecall_3st_Place | 508c263e72184e28ad6c5eadf637095761e5e035 | [
"Apache-2.0"
] | 4 | 2020-07-31T06:16:05.000Z | 2021-02-18T08:24:18.000Z | # -*- coding: utf-8 -*-
import tensorflow as tf
import datetime
import os
import utils.flag_setup as flag_setup
import utils.json_reader as json_reader
import model.estimator_builder as estimator_builder
tf.logging.set_verbosity(tf.logging.INFO)
def local_run(model_json):
epoch_steps = int(flag_setup.FLAGS.epo... | 39.754902 | 129 | 0.725031 |
import tensorflow as tf
import datetime
import os
import utils.flag_setup as flag_setup
import utils.json_reader as json_reader
import model.estimator_builder as estimator_builder
tf.logging.set_verbosity(tf.logging.INFO)
def local_run(model_json):
epoch_steps = int(flag_setup.FLAGS.epoch_samples/model_json['m... | true | true |
1c03f07856b2e4ce7274f02f331b603e9d97f1e7 | 236 | py | Python | Python/py-collections-deque.py | DacioRomero/HackerRank | d1d43bd23e319bf8015a741eca70ba471a13c045 | [
"MIT"
] | 1 | 2020-07-28T00:08:38.000Z | 2020-07-28T00:08:38.000Z | Python/py-collections-deque.py | DacioRomero/HackerRank | d1d43bd23e319bf8015a741eca70ba471a13c045 | [
"MIT"
] | null | null | null | Python/py-collections-deque.py | DacioRomero/HackerRank | d1d43bd23e319bf8015a741eca70ba471a13c045 | [
"MIT"
] | null | null | null | from collections import deque
def main():
d = deque()
for _ in range(int(input())):
method, *arguments = input().split()
getattr(d, method)(*arguments)
print(*d)
if __name__ == '__main__':
main()
| 16.857143 | 44 | 0.567797 | from collections import deque
def main():
d = deque()
for _ in range(int(input())):
method, *arguments = input().split()
getattr(d, method)(*arguments)
print(*d)
if __name__ == '__main__':
main()
| true | true |
1c03f18a31ffaa2d2337c2d74e57ce42d24ddd09 | 6,654 | py | Python | test/util/bitcoin-util-test.py | girino/girinocoin | 3a3acef25ec1d5f41666f4e3565f6f507fea4e83 | [
"MIT"
] | null | null | null | test/util/bitcoin-util-test.py | girino/girinocoin | 3a3acef25ec1d5f41666f4e3565f6f507fea4e83 | [
"MIT"
] | null | null | null | test/util/bitcoin-util-test.py | girino/girinocoin | 3a3acef25ec1d5f41666f4e3565f6f507fea4e83 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework for girinocoin utils.
Runs automatically during `make check`.
... | 36.762431 | 125 | 0.63706 |
from __future__ import division,print_function,unicode_literals
import argparse
import binascii
try:
import configparser
except ImportError:
import ConfigParser as configparser
import difflib
import json
import logging
import os
import pprint
import subprocess
import sys
def main():
config = configparser... | true | true |
1c03f1ec2f4184be4311e30912f0a43001714267 | 2,817 | py | Python | autoarray/inversion/inversion/inversion_interferometer_util.py | caoxiaoyue/PyAutoArray | e10d3d6a5b8dd031f2ad277486bd539bd5858b2a | [
"MIT"
] | null | null | null | autoarray/inversion/inversion/inversion_interferometer_util.py | caoxiaoyue/PyAutoArray | e10d3d6a5b8dd031f2ad277486bd539bd5858b2a | [
"MIT"
] | null | null | null | autoarray/inversion/inversion/inversion_interferometer_util.py | caoxiaoyue/PyAutoArray | e10d3d6a5b8dd031f2ad277486bd539bd5858b2a | [
"MIT"
] | null | null | null | import logging
import numpy as np
from typing import Tuple
from autoarray import numba_util
logger = logging.getLogger(__name__)
@numba_util.jit()
def w_tilde_data_interferometer_from(
visibilities_real: np.ndarray,
noise_map_real: np.ndarray,
uv_wavelengths: np.ndarray,
grid_radians... | 33.535714 | 121 | 0.731629 | import logging
import numpy as np
from typing import Tuple
from autoarray import numba_util
logger = logging.getLogger(__name__)
@numba_util.jit()
def w_tilde_data_interferometer_from(
visibilities_real: np.ndarray,
noise_map_real: np.ndarray,
uv_wavelengths: np.ndarray,
grid_radians... | true | true |
1c03f3e9db3260e940662217308aef52a076538e | 4,301 | py | Python | qa/rpc-tests/smartfees.py | utopiacoin/utopiacoin1 | d1cb408de3dd693f9dcd3ce8b92afa6eb9b8325e | [
"MIT"
] | null | null | null | qa/rpc-tests/smartfees.py | utopiacoin/utopiacoin1 | d1cb408de3dd693f9dcd3ce8b92afa6eb9b8325e | [
"MIT"
] | null | null | null | qa/rpc-tests/smartfees.py | utopiacoin/utopiacoin1 | d1cb408de3dd693f9dcd3ce8b92afa6eb9b8325e | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test fee estimation code
#
from test_framework import NewcoinTestFramework
from newcoinrpc.authproxy impo... | 46.247312 | 114 | 0.607533 |
from test_framework import NewcoinTestFramework
from newcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
class EstimateFeeTest(NewcoinTestFramework):
def setup_network(self):
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir,
... | true | true |
1c03f45227ba097797bee71559e508fee1113a83 | 17,580 | py | Python | tests/nuts_script.py | PNNL-Comp-Mass-Spec/CRNT4SBML | 20406f452863f35f766b504fe2b3f3ab034b62fe | [
"Apache-2.0"
] | null | null | null | tests/nuts_script.py | PNNL-Comp-Mass-Spec/CRNT4SBML | 20406f452863f35f766b504fe2b3f3ab034b62fe | [
"Apache-2.0"
] | 1 | 2019-09-26T21:04:31.000Z | 2019-09-26T21:04:31.000Z | tests/nuts_script.py | PNNL-Comp-Mass-Spec/CRNT4SBML | 20406f452863f35f766b504fe2b3f3ab034b62fe | [
"Apache-2.0"
] | 1 | 2019-10-29T20:41:34.000Z | 2019-10-29T20:41:34.000Z | import sys
sys.path.insert(0, "..")
import crnt4sbml
import numpy
import sympy
import pandas
import scipy.integrate as itg
import dill
from plotnine import ggplot, aes, geom_line, ylim, scale_color_distiller, facet_wrap, theme_bw, geom_path, geom_point, labs, annotate
from matplotlib import rc
rc('text', usetex=True)
... | 40.045558 | 152 | 0.619056 | import sys
sys.path.insert(0, "..")
import crnt4sbml
import numpy
import sympy
import pandas
import scipy.integrate as itg
import dill
from plotnine import ggplot, aes, geom_line, ylim, scale_color_distiller, facet_wrap, theme_bw, geom_path, geom_point, labs, annotate
from matplotlib import rc
rc('text', usetex=True)
... | true | true |
1c03f56b518685b5d384dc5fca64182ed2529106 | 2,366 | py | Python | test/test_user_public_list.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 2 | 2020-01-30T23:28:59.000Z | 2020-05-06T16:43:47.000Z | test/test_user_public_list.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | 1 | 2020-10-02T18:00:25.000Z | 2020-10-02T18:00:25.000Z | test/test_user_public_list.py | pollination/python-sdk | 599e8dbfc6e547c5e18aa903b27c70d7ffef84e5 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
pollination-server
Pollination Server OpenAPI Definition # noqa: E501
The version of the OpenAPI document: 0.16.0
Contact: info@pollination.cloud
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import... | 31.131579 | 88 | 0.561285 |
from __future__ import absolute_import
import unittest
import datetime
import pollination_sdk
from pollination_sdk.models.user_public_list import UserPublicList from pollination_sdk.rest import ApiException
class TestUserPublicList(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
... | true | true |
1c03f5d57bd5dadfd312d00132bd3ceae86e8851 | 645 | py | Python | apps/log_measure/migrations/0008_auto_20211209_1926.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 75 | 2021-07-14T09:32:36.000Z | 2022-03-31T15:26:53.000Z | apps/log_measure/migrations/0008_auto_20211209_1926.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 561 | 2021-07-14T07:45:47.000Z | 2022-03-31T11:41:28.000Z | apps/log_measure/migrations/0008_auto_20211209_1926.py | qqqqqie/bk-log | 1765f1901aafaa6fb6a57b8db5d35dd32b3cb5c1 | [
"MIT"
] | 41 | 2021-07-14T07:39:50.000Z | 2022-03-25T09:22:18.000Z | # Generated by Django 2.2.6 on 2021-12-09 11:26
from django.db import migrations
from apps.utils.log import logger
from apps.log_measure.constants import DATA_NAMES, BK_MONITOR_CLIENT
def forwards_func(apps, schema_editor):
try:
BK_MONITOR_CLIENT.custom_metric().migrate(data_name_list=Migration.data_na... | 26.875 | 86 | 0.739535 |
from django.db import migrations
from apps.utils.log import logger
from apps.log_measure.constants import DATA_NAMES, BK_MONITOR_CLIENT
def forwards_func(apps, schema_editor):
try:
BK_MONITOR_CLIENT.custom_metric().migrate(data_name_list=Migration.data_names)
except Exception as e: logger.... | true | true |
1c03f690fb1014ccc1540ce5705cdf8b5eeef961 | 9,335 | py | Python | research/object_detection_app/builders/losses_builder.py | szhaofelicia/models-1.13.0-app | 6213767f02ecf309d2af91989b4c081bf85f3bf9 | [
"Apache-2.0"
] | null | null | null | research/object_detection_app/builders/losses_builder.py | szhaofelicia/models-1.13.0-app | 6213767f02ecf309d2af91989b4c081bf85f3bf9 | [
"Apache-2.0"
] | null | null | null | research/object_detection_app/builders/losses_builder.py | szhaofelicia/models-1.13.0-app | 6213767f02ecf309d2af91989b4c081bf85f3bf9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 36.182171 | 81 | 0.761543 |
import functools
from core import balanced_positive_negative_sampler as sampler
from core import losses
from protos import losses_pb2
from utils import ops
def build(loss_config):
classification_loss = _build_classification_loss(
loss_config.classification_loss)
localization_loss = _build_localization_lo... | true | true |
1c03f6c4a20cedac5c8022a08081d89261535b5b | 6,399 | py | Python | src/alfasim_sdk/_internal/cli.py | prusse-martin/alfasim-sdk | f6992cb3c1c51e25bf55470508f406ee6c5a5e9b | [
"MIT"
] | null | null | null | src/alfasim_sdk/_internal/cli.py | prusse-martin/alfasim-sdk | f6992cb3c1c51e25bf55470508f406ee6c5a5e9b | [
"MIT"
] | null | null | null | src/alfasim_sdk/_internal/cli.py | prusse-martin/alfasim-sdk | f6992cb3c1c51e25bf55470508f406ee6c5a5e9b | [
"MIT"
] | null | null | null | import os
import subprocess
import sys
from pathlib import Path
import click
from hookman.hookman_generator import HookManGenerator
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
plugin_dir_option = click.option(
"--plugin-dir",
default=os.getcwd(),
type=click.Path(exists=True, file_okay=Fa... | 32.815385 | 127 | 0.692608 | import os
import subprocess
import sys
from pathlib import Path
import click
from hookman.hookman_generator import HookManGenerator
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
plugin_dir_option = click.option(
"--plugin-dir",
default=os.getcwd(),
type=click.Path(exists=True, file_okay=Fa... | true | true |
1c03f7200a3b6cea57e5a47a94835c42984dbdcd | 10,850 | py | Python | ResNet-101/CALTECH-101/whitebox_and_black.py | GuanlinLee/FPD-for-Adversarial-Robustness | 76b06cb8a68469f8ed4ed6bb5479ee86719175fb | [
"MIT"
] | 11 | 2020-03-16T06:07:14.000Z | 2021-09-08T11:51:23.000Z | ResNet-101/CALTECH-101/whitebox_and_black.py | GuanlinLee/FPD-for-Adversarial-Robustness | 76b06cb8a68469f8ed4ed6bb5479ee86719175fb | [
"MIT"
] | 2 | 2020-08-25T06:03:50.000Z | 2021-07-08T03:47:09.000Z | ResNet-101/CALTECH-101/whitebox_and_black.py | GuanlinLee/FPD-for-Adversarial-Robustness | 76b06cb8a68469f8ed4ed6bb5479ee86719175fb | [
"MIT"
] | 5 | 2020-03-16T12:29:21.000Z | 2021-12-13T07:32:30.000Z | import torch.nn as nn
import torchvision.transforms as transforms
from torch.autograd import Variable
from art.data_generators import *
from art.utils import *
from art.classifiers import *
from art.attacks import *
import numpy as np
import resnet as resnet
import argparse
import models
from tqdm import tqdm
parser = ... | 38.070175 | 148 | 0.659816 | import torch.nn as nn
import torchvision.transforms as transforms
from torch.autograd import Variable
from art.data_generators import *
from art.utils import *
from art.classifiers import *
from art.attacks import *
import numpy as np
import resnet as resnet
import argparse
import models
from tqdm import tqdm
parser = ... | true | true |
1c03f7373102d4490fb755ea0af727dac3cf4640 | 6,822 | py | Python | ais/utilities.py | vt-rocksat-2017/dashboard | e99a71edc74dd8b7f3eec023c381524561a7b6e4 | [
"MIT"
] | 1 | 2017-08-09T19:57:38.000Z | 2017-08-09T19:57:38.000Z | ais/utilities.py | vt-rocksat-2017/dashboard | e99a71edc74dd8b7f3eec023c381524561a7b6e4 | [
"MIT"
] | null | null | null | ais/utilities.py | vt-rocksat-2017/dashboard | e99a71edc74dd8b7f3eec023c381524561a7b6e4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from math import *
import string
import time
import sys
import csv
import os
from datetime import datetime as date
import numpy as np
import binascii
from ais_ascii import *
import _ais as ais
deg2rad = pi / 180.0
rad2deg = 180.0 / pi
c = float(299792458) #[m/s], speed of light
R_e = 6... | 36.481283 | 106 | 0.586338 | from math import *
import string
import time
import sys
import csv
import os
from datetime import datetime as date
import numpy as np
import binascii
from ais_ascii import *
import _ais as ais
deg2rad = pi / 180.0
rad2deg = 180.0 / pi
c = float(299792458) R_e = 6378.137 e_e = 0.081819221456
cl... | false | true |
1c03f7c975da0ea1b62ee78c2b3ac63bb9d9dfdf | 3,146 | py | Python | contrib/devtools/circular-dependencies.py | BABY636-Guarda-CRUX/bitcoin | 1c9c0ea9d360bc3eda44305e0a73ab910d550143 | [
"MIT"
] | 1 | 2020-07-05T20:06:21.000Z | 2020-07-05T20:06:21.000Z | contrib/devtools/circular-dependencies.py | baby636/bitcoin | 1c9c0ea9d360bc3eda44305e0a73ab910d550143 | [
"MIT"
] | null | null | null | contrib/devtools/circular-dependencies.py | baby636/bitcoin | 1c9c0ea9d360bc3eda44305e0a73ab910d550143 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import sys
import re
MAPPING = {
'core_read.cpp': 'core_io.cpp',
'core_write.cpp': 'core_io.cpp',
}
... | 33.827957 | 109 | 0.633503 |
import sys
import re
MAPPING = {
'core_read.cpp': 'core_io.cpp',
'core_write.cpp': 'core_io.cpp',
}
HEADER_MODULE_PATHS = [
'interfaces/'
]
def module_name(path):
return path
if path in MAPPING:
path = MAPPING[path]
if any(path.startswith(dirpath) for dirpath in HEADER_MODULE_PATHS):... | true | true |
1c03f86468f9af935a1a0c6c68179c1e6684354d | 6,750 | py | Python | tune-rnn.py | coltekin/emoji2018 | a6795e248ada9a3cebdb4987574038e4e5affa93 | [
"Unlicense"
] | 7 | 2018-03-22T10:59:40.000Z | 2021-03-09T23:35:45.000Z | tune-rnn.py | coltekin/emoji2018 | a6795e248ada9a3cebdb4987574038e4e5affa93 | [
"Unlicense"
] | 2 | 2018-03-27T07:05:31.000Z | 2020-01-19T16:27:53.000Z | tune-rnn.py | coltekin/emoji2018 | a6795e248ada9a3cebdb4987574038e4e5affa93 | [
"Unlicense"
] | 3 | 2020-01-19T15:47:59.000Z | 2021-03-18T23:02:15.000Z | #!/usr/bin/env python3
from emoji_data import load
from features import doc_to_numseq
import random
import numpy as np
from sklearn.model_selection import StratifiedShuffleSplit
from collections import Counter
from keras.preprocessing.sequence import pad_sequences
from keras.utils.np_utils import to_categorical
from ke... | 34.615385 | 94 | 0.619259 | from emoji_data import load
from features import doc_to_numseq
import random
import numpy as np
from sklearn.model_selection import StratifiedShuffleSplit
from collections import Counter
from keras.preprocessing.sequence import pad_sequences
from keras.utils.np_utils import to_categorical
from keras.layers import Input... | true | true |
1c03f9e1452e29a6a0b8e4d8cf36e10ede624993 | 3,258 | py | Python | hackerrank/algorithms/graph-theory/rust-murderer/rust-murderer.py | EliahKagan/practice | 715d46e4b590359f456b0f094d5f7d02637baf97 | [
"0BSD"
] | null | null | null | hackerrank/algorithms/graph-theory/rust-murderer/rust-murderer.py | EliahKagan/practice | 715d46e4b590359f456b0f094d5f7d02637baf97 | [
"0BSD"
] | null | null | null | hackerrank/algorithms/graph-theory/rust-murderer/rust-murderer.py | EliahKagan/practice | 715d46e4b590359f456b0f094d5f7d02637baf97 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
"""
https://www.hackerrank.com/challenges/rust-murderer
In Python 3. Using BFS and an adjacency list in which each row is a sorted list
of forward *non*-neighbors.
"""
import collections
import sys
def read_value():
"""Reads a line as a single integer."""
return int(input())
def rea... | 25.653543 | 79 | 0.616329 |
import collections
import sys
def read_value():
return int(input())
def read_record():
return map(int, input().split())
def read_graph():
vertex_count, edge_count = read_record()
if vertex_count < 0:
raise ValueError("can't have negatively many vertices")
if edge_count < 0:
ra... | true | true |
1c03fa4981dbd58d6740dcc6e32f8814e62dc467 | 3,550 | py | Python | aligner_wrapper.py | rbr7/single-cell_rna-seq | 2c69a9e5a8b474fc7313213df045510314034465 | [
"MIT"
] | null | null | null | aligner_wrapper.py | rbr7/single-cell_rna-seq | 2c69a9e5a8b474fc7313213df045510314034465 | [
"MIT"
] | null | null | null | aligner_wrapper.py | rbr7/single-cell_rna-seq | 2c69a9e5a8b474fc7313213df045510314034465 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse, subprocess, os
def checkFASTQ(list1, list2):
#Checking if lengths are the same, since they are paired end reads:
if len(list1) == len(list2):
#Since the lengths are the same, check if the files end with _1.fastq and _2.fastq
for i in range(0, len(list1)... | 47.333333 | 198 | 0.648451 |
import argparse, subprocess, os
def checkFASTQ(list1, list2):
if len(list1) == len(list2):
for i in range(0, len(list1)):
if list1[i].endswith("_1.fastq") and list2[i].endswith("_2.fastq"): status = True
else:
status = False
return status
def runK... | true | true |
1c03fa7969aa25ab88120a204ae5125cd8fef673 | 8,238 | py | Python | nets/bagnet.py | inspire-group/PatchGuard | 5ca61b8a3d3814d72ee64d5587d02147fc216478 | [
"MIT"
] | 46 | 2020-06-11T16:14:07.000Z | 2022-03-31T09:21:29.000Z | nets/bagnet.py | inspire-group/PatchGuard | 5ca61b8a3d3814d72ee64d5587d02147fc216478 | [
"MIT"
] | 1 | 2021-04-22T21:18:43.000Z | 2021-04-27T01:19:10.000Z | nets/bagnet.py | inspire-group/PatchGuard | 5ca61b8a3d3814d72ee64d5587d02147fc216478 | [
"MIT"
] | 7 | 2020-09-29T23:54:50.000Z | 2022-03-17T14:23:12.000Z | #################################################################################################################
# Adapted from https://github.com/wielandbrendel/bag-of-local-features-models/blob/master/bagnets/pytorchnet.py #
# Mainly changed the model forward() function ... | 41.817259 | 167 | 0.578053 |
import torch.nn as nn
import math
import random
import torch
from collections import OrderedDict
from torch.utils import model_zoo
import numpy as np
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
__all__ = ['bagnet9', 'bagnet17', 'bagnet33']
model_urls = {
'bagnet9': 'https://bitbuc... | true | true |
1c03fab728ddf490b1d83fddedacbc46ef350529 | 2,381 | py | Python | trans2excel.py | btrspg/txt2excel | d6fd2a916a33390cdbe13a92940e151452e08bf2 | [
"MIT"
] | null | null | null | trans2excel.py | btrspg/txt2excel | d6fd2a916a33390cdbe13a92940e151452e08bf2 | [
"MIT"
] | null | null | null | trans2excel.py | btrspg/txt2excel | d6fd2a916a33390cdbe13a92940e151452e08bf2 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import os
import xlwt
import readtxt
class trans2excel():
'''
trans text files to a excel file(.xls)
__init__:
*args:路径
**kwargs:
output:输出prefix,默认:./tmp
sep:分隔符,默认:\t
type:输出类型,默认:xls(暂时只能输出这种)
'''
def __init__(self, *path, output='./tmp', sep='\t', ... | 29.395062 | 81 | 0.52415 |
import os
import xlwt
import readtxt
class trans2excel():
def __init__(self, *path, output='./tmp', sep='\t', type='xls'):
self._path = path
self._out = output
self._sep = sep
self._type = type
self._files = []
def _isfile(self, mydir):
for lists in os.listdir... | true | true |
1c03fccb01f1affd516b651fe854c6efafdea830 | 3,834 | py | Python | analyzer_service/api/__main__.py | Speccy-Rom/celebrate | 4f9e72658ca16fcd0d3ada5ba5befbe9b721aa91 | [
"MIT"
] | null | null | null | analyzer_service/api/__main__.py | Speccy-Rom/celebrate | 4f9e72658ca16fcd0d3ada5ba5befbe9b721aa91 | [
"MIT"
] | null | null | null | analyzer_service/api/__main__.py | Speccy-Rom/celebrate | 4f9e72658ca16fcd0d3ada5ba5befbe9b721aa91 | [
"MIT"
] | null | null | null | """
REST API service will analyse the data provided and identify
the demand for gifts among residents of different age groups
in different cities by month
"""
import argparse
import logging
import os
import pwd
from sys import argv
from aiohttp.web import run_app
from aiomisc import bind_socket
from aiomisc.log import... | 39.122449 | 79 | 0.732394 | import argparse
import logging
import os
import pwd
from sys import argv
from aiohttp.web import run_app
from aiomisc import bind_socket
from aiomisc.log import LogFormat, basic_config
from configargparse import ArgumentParser
from setproctitle import setproctitle
from yarl import URL
from analyzer_service.api.app im... | true | true |
1c03fcea49929761c5fa198a12faee366540ae79 | 1,681 | py | Python | nixpkgs_review/tests/test_github_actions.py | 0mbi/nixpkgs-review | 9510cc0e55c41f9588d2c200cd2dcd33ed10e7a7 | [
"MIT"
] | null | null | null | nixpkgs_review/tests/test_github_actions.py | 0mbi/nixpkgs-review | 9510cc0e55c41f9588d2c200cd2dcd33ed10e7a7 | [
"MIT"
] | null | null | null | nixpkgs_review/tests/test_github_actions.py | 0mbi/nixpkgs-review | 9510cc0e55c41f9588d2c200cd2dcd33ed10e7a7 | [
"MIT"
] | null | null | null | import os
from nixpkgs_review.cli import main
from .cli_mocks import CliTestCase, Mock, IgnoreArgument, MockCompletedProcess
from unittest.mock import patch, mock_open, MagicMock
from typing import List, Tuple, Any
from pathlib import Path
def dummy_api_response() -> List[Tuple[Any, Any]]:
return [(IgnoreArgument... | 32.960784 | 85 | 0.64069 | import os
from nixpkgs_review.cli import main
from .cli_mocks import CliTestCase, Mock, IgnoreArgument, MockCompletedProcess
from unittest.mock import patch, mock_open, MagicMock
from typing import List, Tuple, Any
from pathlib import Path
def dummy_api_response() -> List[Tuple[Any, Any]]:
return [(IgnoreArgument... | true | true |
1c03fecf32d5b810f0dc2eb4110c0b5f5643ce79 | 73 | py | Python | src/globals.py | gregorkrz/dna-melt-analysis | c2cd8ca98474c8e94457c0ea5f692a2a8a133c1a | [
"MIT"
] | null | null | null | src/globals.py | gregorkrz/dna-melt-analysis | c2cd8ca98474c8e94457c0ea5f692a2a8a133c1a | [
"MIT"
] | null | null | null | src/globals.py | gregorkrz/dna-melt-analysis | c2cd8ca98474c8e94457c0ea5f692a2a8a133c1a | [
"MIT"
] | null | null | null | data_set = []
dna_conc = []
T = []
A = []
interpolated = []
Ts = 0
| 10.428571 | 18 | 0.452055 | data_set = []
dna_conc = []
T = []
A = []
interpolated = []
Ts = 0
| true | true |
1c03feda805f9191bc1b3174f317bcd2187a59e7 | 3,554 | py | Python | plugins/SlackTarget.py | grahams/trackupdate | 9924f29eb258cdd4d08bdc7195e36ee6b3877061 | [
"MIT"
] | 2 | 2020-04-11T14:59:54.000Z | 2021-02-12T22:59:54.000Z | plugins/SlackTarget.py | grahams/trackupdate | 9924f29eb258cdd4d08bdc7195e36ee6b3877061 | [
"MIT"
] | 7 | 2020-04-15T21:52:18.000Z | 2021-01-26T03:40:44.000Z | plugins/SlackTarget.py | grahams/trackupdate | 9924f29eb258cdd4d08bdc7195e36ee6b3877061 | [
"MIT"
] | 2 | 2015-07-24T21:30:33.000Z | 2017-05-24T19:58:38.000Z | # Copyright (c) 2017-2020 Sean T. Hammond, Sean M. Graham
#
# 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, modif... | 33.847619 | 80 | 0.574282 |
from Target import Target
import configparser
import os
import string
import subprocess
import json
import requests
import logging
import uuid
import time
class SlackTarget(Target):
pluginName = "Slack Track Updater"
logger = logging.getLogger("slack updater")
slackWebHookUrl = ""
def __init__(self,... | true | true |
1c03fef5e4b8f8ff8a40a3ff80494d781b91fe24 | 13,598 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_sniffer.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_sniffer.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_sniffer.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
# Copyright 2019-2021 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | 33.085158 | 153 | 0.467201 | from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fmgr_system_sniffer
short_description: Interface sniffer.
de... | true | true |
1c03fefb4270eea95c108b82a440cba5ffc7e117 | 210 | py | Python | astroquery/fermi/__init__.py | jdnc/astroquery | a89dcc5f4132bc2e9d72da1aa583dbc9e7e8216f | [
"BSD-3-Clause"
] | 1 | 2019-12-17T00:43:56.000Z | 2019-12-17T00:43:56.000Z | astroquery/fermi/__init__.py | jdnc/astroquery | a89dcc5f4132bc2e9d72da1aa583dbc9e7e8216f | [
"BSD-3-Clause"
] | null | null | null | astroquery/fermi/__init__.py | jdnc/astroquery | a89dcc5f4132bc2e9d72da1aa583dbc9e7e8216f | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Access to Fermi Gamma-ray Space Telescope data.
http://fermi.gsfc.nasa.gov
http://fermi.gsfc.nasa.gov/ssc/data/
"""
from .lat_data import *
| 23.333333 | 63 | 0.728571 | from .lat_data import *
| true | true |
1c040056690ffe3ac1490e4e7c7b5d1f2d00626b | 85,283 | py | Python | aesara/compile/debugmode.py | danhphan/aesara | 5a0fb0e731358d54648823170acd911cc1534d6a | [
"BSD-3-Clause"
] | null | null | null | aesara/compile/debugmode.py | danhphan/aesara | 5a0fb0e731358d54648823170acd911cc1534d6a | [
"BSD-3-Clause"
] | null | null | null | aesara/compile/debugmode.py | danhphan/aesara | 5a0fb0e731358d54648823170acd911cc1534d6a | [
"BSD-3-Clause"
] | null | null | null | """
Provides `DebugMode`, an evaluation mode for debugging aesara internals.
TODO: add support for IfElse Op, LazyLinker, etc.
"""
import copy
import gc
import logging
import sys
from io import StringIO
from itertools import chain
from itertools import product as itertools_product
from logging import Logger
from ty... | 36.696644 | 108 | 0.519939 |
import copy
import gc
import logging
import sys
from io import StringIO
from itertools import chain
from itertools import product as itertools_product
from logging import Logger
from typing import Optional
from warnings import warn
import numpy as np
import aesara
from aesara.compile.function.types import (
Fun... | true | true |
1c0400ffe5d73bf108cf527e0597aed32ad08514 | 434 | py | Python | data/scripts/templates/object/mobile/shared_blastromech.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_blastromech.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_blastromech.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_blastromech.iff"
result.attribute_template_id = 9
result.stfN... | 25.529412 | 57 | 0.723502 |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_blastromech.iff"
result.attribute_template_id = 9
result.stfName("droid_name","blastromech")
return result | true | true |
1c0401a62c0fa61dfdb28baa9eb717e339ea3c6c | 24,191 | py | Python | train_extractive_summary.py | jireh-father/KoBERT | 13b10589979d9a17137edcbd34c5dcee7eb552f7 | [
"Apache-2.0"
] | null | null | null | train_extractive_summary.py | jireh-father/KoBERT | 13b10589979d9a17137edcbd34c5dcee7eb552f7 | [
"Apache-2.0"
] | null | null | null | train_extractive_summary.py | jireh-father/KoBERT | 13b10589979d9a17137edcbd34c5dcee7eb552f7 | [
"Apache-2.0"
] | null | null | null | import os
import argparse
import random
import numpy as np
import torch
from kobert.pytorch_kobert import get_pytorch_kobert_model
import jsonlines
from torch.utils import data
from gluonnlp.data import SentencepieceTokenizer
from kobert.utils import get_tokenizer
from torch import nn
from torch.nn.utils.rnn import pad... | 44.46875 | 120 | 0.620727 | import os
import argparse
import random
import numpy as np
import torch
from kobert.pytorch_kobert import get_pytorch_kobert_model
import jsonlines
from torch.utils import data
from gluonnlp.data import SentencepieceTokenizer
from kobert.utils import get_tokenizer
from torch import nn
from torch.nn.utils.rnn import pad... | true | true |
1c0401f2546e7080c23f8cfea294ee40819e13df | 1,675 | py | Python | fixture/db.py | nechaeva-irina/python_training | f4e4c1788525b64ce86eefe261cdb4adfa32f839 | [
"Apache-2.0"
] | null | null | null | fixture/db.py | nechaeva-irina/python_training | f4e4c1788525b64ce86eefe261cdb4adfa32f839 | [
"Apache-2.0"
] | null | null | null | fixture/db.py | nechaeva-irina/python_training | f4e4c1788525b64ce86eefe261cdb4adfa32f839 | [
"Apache-2.0"
] | null | null | null | import pymysql.cursors
from model.group import Group
from model.contact import Contact
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection = pymysql.connect(host=host, ... | 37.222222 | 167 | 0.601791 | import pymysql.cursors
from model.group import Group
from model.contact import Contact
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection = pymysql.connect(host=host, ... | true | true |
1c04020fb5fb74590c762fb5d29aced5069f91f0 | 433 | py | Python | src/algorithms/main/misce/cache.py | JoelGRod/Algorithms-py | 085dbf5d2d62adf41cfd59313827f83e2da6bc81 | [
"MIT"
] | null | null | null | src/algorithms/main/misce/cache.py | JoelGRod/Algorithms-py | 085dbf5d2d62adf41cfd59313827f83e2da6bc81 | [
"MIT"
] | null | null | null | src/algorithms/main/misce/cache.py | JoelGRod/Algorithms-py | 085dbf5d2d62adf41cfd59313827f83e2da6bc81 | [
"MIT"
] | null | null | null |
urls = {}
def check_url(url):
if urls.get(url):
return f"{urls[url]} - cached"
else:
data = f"some data obtained from url {url}"
urls[url] = data
return data
def main():
pages = ["www.google.com", "www.elsitio.com", "www.twitter.com", "www.google.com", "www.elsitio.com"]
... | 20.619048 | 105 | 0.56351 |
urls = {}
def check_url(url):
if urls.get(url):
return f"{urls[url]} - cached"
else:
data = f"some data obtained from url {url}"
urls[url] = data
return data
def main():
pages = ["www.google.com", "www.elsitio.com", "www.twitter.com", "www.google.com", "www.elsitio.com"]
... | true | true |
1c0403530345c381c35de5640b83c6a95d769696 | 5,530 | py | Python | ClassScheduler.py | ptrChar/Class-Reminder-Discord-Bot | e2bad91c96ea662b1f8c0fb6b48c14982dcd1470 | [
"Apache-2.0"
] | null | null | null | ClassScheduler.py | ptrChar/Class-Reminder-Discord-Bot | e2bad91c96ea662b1f8c0fb6b48c14982dcd1470 | [
"Apache-2.0"
] | null | null | null | ClassScheduler.py | ptrChar/Class-Reminder-Discord-Bot | e2bad91c96ea662b1f8c0fb6b48c14982dcd1470 | [
"Apache-2.0"
] | null | null | null | from currentTime import *
from writeToFile import *
'''
Course()
- stores sessions' name, time, info, and days
- a new instance of the course class is initialized when the user calls .addclass
'''
class Course():
def __init__(self, name : str, days : list, scheduledTime : str, info : str):
self.nam... | 38.943662 | 150 | 0.668354 | from currentTime import *
from writeToFile import *
class Course():
def __init__(self, name : str, days : list, scheduledTime : str, info : str):
self.name = name
self.time = scheduledTime
self.info = info
self.days = days
class User():
def __init__(self, id : int, name, mentio... | true | true |
1c0403cfeaa0b23a38c47ef27e9ec409e4403bc4 | 4,403 | py | Python | test/functional/p2p_zpos_fakestake_accepted.py | blenda123/labx | 2d6495c3e93fe6e6b734d5bc183d09821a3d0991 | [
"MIT"
] | 3 | 2019-07-14T15:43:43.000Z | 2020-09-17T04:01:50.000Z | test/functional/p2p_zpos_fakestake_accepted.py | blenda123/labx | 2d6495c3e93fe6e6b734d5bc183d09821a3d0991 | [
"MIT"
] | null | null | null | test/functional/p2p_zpos_fakestake_accepted.py | blenda123/labx | 2d6495c3e93fe6e6b734d5bc183d09821a3d0991 | [
"MIT"
] | 5 | 2019-04-30T22:18:20.000Z | 2020-07-02T21:20:02.000Z | #!/usr/bin/env python3
# Copyright (c) 2019 The Stakinglab Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Performs the same check as in Test_02 verifying that zPoS forked blocks that stake a zerocoin which is ... | 37.313559 | 189 | 0.62094 |
from test_framework.authproxy import JSONRPCException
from fake_stake.base_test import LABX_FakeStakeTest
from time import sleep
class zPoSFakeStakeAccepted(LABX_FakeStakeTest):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.extra_args = [['-staking=1',... | true | true |
1c0403fbef4be745773376b395349e567f0b86a9 | 132 | py | Python | tests/data/validation/DATASET2/reference.py | kids-first/kf-lib-data-ingest | 92889efef082c64744a00a9c110d778da7383959 | [
"Apache-2.0"
] | 3 | 2018-10-30T17:56:44.000Z | 2020-05-27T16:18:05.000Z | tests/data/validation/DATASET2/reference.py | kids-first/kf-lib-data-ingest | 92889efef082c64744a00a9c110d778da7383959 | [
"Apache-2.0"
] | 344 | 2018-11-01T16:47:56.000Z | 2022-02-23T20:36:21.000Z | tests/data/validation/DATASET2/reference.py | kids-first/kf-lib-data-ingest | 92889efef082c64744a00a9c110d778da7383959 | [
"Apache-2.0"
] | 1 | 2020-08-19T21:25:25.000Z | 2020-08-19T21:25:25.000Z | counts = {
"FAMILY|ID": 3,
"PARTICIPANT|ID": 3,
"BIOSPECIMEN|ID": 3,
"GENOMIC_FILE|URL_LIST": 3,
}
validation = {}
| 14.666667 | 31 | 0.560606 | counts = {
"FAMILY|ID": 3,
"PARTICIPANT|ID": 3,
"BIOSPECIMEN|ID": 3,
"GENOMIC_FILE|URL_LIST": 3,
}
validation = {}
| true | true |
1c0404791245ff868c2bc0764362eee90226f8c1 | 400 | py | Python | isimip_data/annotations/migrations/0007_alter_annotation_specifiers.py | ISI-MIP/isimip-data | a0e4772362cc60db91e7689ec397840dcaaacddb | [
"MIT"
] | 3 | 2020-02-10T10:13:17.000Z | 2021-12-21T09:10:50.000Z | isimip_data/annotations/migrations/0007_alter_annotation_specifiers.py | ISI-MIP/isimip-data | a0e4772362cc60db91e7689ec397840dcaaacddb | [
"MIT"
] | 17 | 2020-02-10T16:09:12.000Z | 2021-07-02T09:03:37.000Z | isimip_data/annotations/migrations/0007_alter_annotation_specifiers.py | ISI-MIP/isimip-data | a0e4772362cc60db91e7689ec397840dcaaacddb | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-27 15:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('annotations', '0006_annotation_references'),
]
operations = [
migrations.AlterField(
model_name='annotation',
name='... | 21.052632 | 54 | 0.6125 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('annotations', '0006_annotation_references'),
]
operations = [
migrations.AlterField(
model_name='annotation',
name='specifiers',
field=models.JSONField(... | true | true |
1c040554ff985672b68e85ace76f58ae70975f32 | 16,065 | py | Python | fiddle/experimental/auto_config.py | google/fiddle | 54b8d2a007f1eaed070a8852abe50152a4b1b206 | [
"Apache-2.0"
] | 8 | 2022-03-26T17:31:52.000Z | 2022-03-31T23:00:21.000Z | fiddle/experimental/auto_config.py | google/fiddle | 54b8d2a007f1eaed070a8852abe50152a4b1b206 | [
"Apache-2.0"
] | null | null | null | fiddle/experimental/auto_config.py | google/fiddle | 54b8d2a007f1eaed070a8852abe50152a4b1b206 | [
"Apache-2.0"
] | 1 | 2022-03-26T18:45:30.000Z | 2022-03-26T18:45:30.000Z | # coding=utf-8
# Copyright 2022 The Fiddle-Config Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 38.710843 | 81 | 0.724245 |
import ast
import builtins
import functools
import inspect
import textwrap
import types
from typing import Any
from fiddle import config
from fiddle.experimental import daglish
_CALL_HANDLER_ID = '__auto_config_call_handler__'
_BUILTINS = frozenset([
builtin for builtin in builtins.__dict__.values()
if insp... | true | true |
1c040639a043ffa3d8cd1e14dabf1e1b4e7cb7ef | 39,480 | py | Python | glance/api/glare/v0_1/glare.py | whitepages/glance | 5fa3e88cb69054ab3ab0cb506749707bef67b0c0 | [
"Apache-2.0"
] | null | null | null | glance/api/glare/v0_1/glare.py | whitepages/glance | 5fa3e88cb69054ab3ab0cb506749707bef67b0c0 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:38:31.000Z | 2021-03-21T11:38:31.000Z | glance/api/glare/v0_1/glare.py | isabella232/glance | 5fa3e88cb69054ab3ab0cb506749707bef67b0c0 | [
"Apache-2.0"
] | 1 | 2021-03-21T11:38:02.000Z | 2021-03-21T11:38:02.000Z | # Copyright (c) 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 43.006536 | 79 | 0.575253 |
import os
import sys
import glance_store
import jsonschema
from oslo_config import cfg
from oslo_serialization import jsonutils as json
from oslo_utils import encodeutils
from oslo_utils import excutils
import semantic_version
import six
import six.moves.urllib.parse as urlparse
import webob.exc
from glance.common i... | true | true |
1c0407336d2cc0ac468ff314f78d76610b7cec45 | 39 | py | Python | python/testData/refactoring/introduceVariable/bytesSubstring.after.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/refactoring/introduceVariable/bytesSubstring.after.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/refactoring/introduceVariable/bytesSubstring.after.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | a = b'bar'
b'foo' + a + b'baz' + suffix | 19.5 | 28 | 0.512821 | a = b'bar'
b'foo' + a + b'baz' + suffix | true | true |
1c04075dc52d00b78036b14f8894ad47755cf0f7 | 1,212 | py | Python | practice43.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | practice43.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | practice43.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | #Task 3
class Panda:
def __init__(self,name,gender,age):
self.name = name
self.gender = gender
self.age = age
def sleep(self,time = None):
if time == None:
food = "bamboo leaves"
time = "unknown"
return(f"{self.name}'s duration is unknown thus ... | 36.727273 | 95 | 0.566007 | class Panda:
def __init__(self,name,gender,age):
self.name = name
self.gender = gender
self.age = age
def sleep(self,time = None):
if time == None:
food = "bamboo leaves"
time = "unknown"
return(f"{self.name}'s duration is unknown thus should h... | true | true |
1c04079b0441b29c5959a4aa42c4895b3dcc2b31 | 4,870 | py | Python | tests/functional_tests.py | informaniac/schort | 7def769bbb80befdcbc5095f3e6a3fc0c52be2f5 | [
"CC0-1.0"
] | null | null | null | tests/functional_tests.py | informaniac/schort | 7def769bbb80befdcbc5095f3e6a3fc0c52be2f5 | [
"CC0-1.0"
] | null | null | null | tests/functional_tests.py | informaniac/schort | 7def769bbb80befdcbc5095f3e6a3fc0c52be2f5 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
import os
import unittest
import requests
from urllib import parse
BASE_URL="http://localhost:5000"
class WebTestCase(object):
def assertPostReq(self, url, data = {}):
req = requests.post(url, data=data)
self.assertEqual(req.status_code, 200, msg="Post request unsuccessful")
return req
... | 39.274194 | 138 | 0.726899 | import os
import unittest
import requests
from urllib import parse
BASE_URL="http://localhost:5000"
class WebTestCase(object):
def assertPostReq(self, url, data = {}):
req = requests.post(url, data=data)
self.assertEqual(req.status_code, 200, msg="Post request unsuccessful")
return req
def assertGetReq(self,... | true | true |
1c0407a8261c4a267602fdb74f21bfe4a06a1824 | 8,609 | py | Python | manuf/manuf.py | mdtomo/wispy | fda67b8709750917d0e2760d87607a4393f7978a | [
"MIT"
] | 10 | 2017-07-01T20:15:02.000Z | 2022-02-18T13:40:40.000Z | manuf/manuf.py | WilliamBenEmbarek/wispy | fda67b8709750917d0e2760d87607a4393f7978a | [
"MIT"
] | 1 | 2017-07-03T02:31:42.000Z | 2017-07-03T02:31:42.000Z | manuf/manuf.py | WilliamBenEmbarek/wispy | fda67b8709750917d0e2760d87607a4393f7978a | [
"MIT"
] | 1 | 2022-02-18T13:02:29.000Z | 2022-02-18T13:02:29.000Z | #!/usr/bin/env python3
# manuf.py: Parser library for Wireshark's OUI database.
# Copyright (c) 2016 Michael Huang
#
# This library is free software. It is dual licensed under the terms of the GNU Lesser General
# Public License version 3.0 (or any later version) and the Apache License version 2.0.
#
# For more inform... | 31.305455 | 99 | 0.601696 |
# Copyright (c) 2016 Michael Huang
#
# This library is free software. It is dual licensed under the terms of the GNU Lesser General
# Public License version 3.0 (or any later version) and the Apache License version 2.0.
#
# For more information, see:
#
# <http://www.gnu.org/licenses/>
# <http://www.apache.org/licenses... | true | true |
1c04099e952a351c93ad8f11e5679221a37c8c82 | 1,437 | py | Python | import_data/tasks/format_stdout.py | QwantResearch/kartotherian_docker | 94f8e3600d296f77659e53f33ecf35ebe2c4f042 | [
"Apache-2.0"
] | 18 | 2017-10-18T16:18:56.000Z | 2020-11-07T01:59:02.000Z | import_data/tasks/format_stdout.py | QwantResearch/kartotherian_docker | 94f8e3600d296f77659e53f33ecf35ebe2c4f042 | [
"Apache-2.0"
] | 26 | 2017-10-19T16:07:11.000Z | 2020-05-05T12:19:15.000Z | import_data/tasks/format_stdout.py | QwantResearch/kartotherian_docker | 94f8e3600d296f77659e53f33ecf35ebe2c4f042 | [
"Apache-2.0"
] | 11 | 2018-03-12T11:57:54.000Z | 2020-08-01T16:41:50.000Z | import sys
from functools import wraps
from invoke import context
class PrefixedStream:
"""
Wrapper class around a stream adding a prefix to each writen line.
"""
def __init__(self, src_stream, prefix):
self.prefix = prefix
self.src_stream = src_stream
self.buffer = ""
d... | 23.177419 | 76 | 0.596381 | import sys
from functools import wraps
from invoke import context
class PrefixedStream:
def __init__(self, src_stream, prefix):
self.prefix = prefix
self.src_stream = src_stream
self.buffer = ""
def write(self, data):
self.buffer += data
self.flush()
def flush(s... | true | true |
1c0409de00407847e68b6ef3ad911f3d439a0f68 | 195 | py | Python | MillerArrays/millerArrayComprehensiveSummary.py | MooersLab/jupyterlabcctbxsnipsplus | 80a380046adcc9b16581ed1681884017514edbb7 | [
"MIT"
] | null | null | null | MillerArrays/millerArrayComprehensiveSummary.py | MooersLab/jupyterlabcctbxsnipsplus | 80a380046adcc9b16581ed1681884017514edbb7 | [
"MIT"
] | null | null | null | MillerArrays/millerArrayComprehensiveSummary.py | MooersLab/jupyterlabcctbxsnipsplus | 80a380046adcc9b16581ed1681884017514edbb7 | [
"MIT"
] | null | null | null | # Description: Show comprehensive summary for a specified Miller array.
# Source: NA
"""
miller_arrays[${1:0}].show_comprehensive_summary()
"""
miller_arrays[0].show_comprehensive_summary()
| 21.666667 | 73 | 0.758974 |
miller_arrays[0].show_comprehensive_summary()
| true | true |
1c040a995021ae4638aadd82cdd59a5419bd4148 | 491 | py | Python | utils.py | jasperla/ropstar | 822365c9c55fb238c6e8a65156faee729c2cf886 | [
"MIT"
] | 2 | 2020-03-15T15:29:25.000Z | 2021-05-17T22:05:38.000Z | utils.py | jasperla/ropstar | 822365c9c55fb238c6e8a65156faee729c2cf886 | [
"MIT"
] | null | null | null | utils.py | jasperla/ropstar | 822365c9c55fb238c6e8a65156faee729c2cf886 | [
"MIT"
] | 2 | 2020-03-23T10:07:28.000Z | 2020-08-15T11:40:26.000Z | import string
from itertools import cycle
from pwn import *
# Author: xct
def rot13(x):
rot13 = string.maketrans(
"ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz",
"NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm")
return string.translate(x, rot13)
def xor(x, key):
enc = [ chr(ord(a) ^ ord... | 22.318182 | 63 | 0.694501 | import string
from itertools import cycle
from pwn import *
def rot13(x):
rot13 = string.maketrans(
"ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz",
"NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm")
return string.translate(x, rot13)
def xor(x, key):
enc = [ chr(ord(a) ^ ord(b)) for (a,b)... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.