hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2b4b0516b2e80a840b0daf7c96171c9f14f54bd2 | 7,172 | py | Python | egs/wham/TwoStep/train.py | saurabh-kataria/asteroid | a0b1d5e43375d5f5d83ba9ec707633659289200f | [
"MIT"
] | null | null | null | egs/wham/TwoStep/train.py | saurabh-kataria/asteroid | a0b1d5e43375d5f5d83ba9ec707633659289200f | [
"MIT"
] | 1 | 2020-05-21T13:14:43.000Z | 2020-05-21T13:14:43.000Z | egs/wham/TwoStep/train.py | saurabh-kataria/asteroid | a0b1d5e43375d5f5d83ba9ec707633659289200f | [
"MIT"
] | null | null | null | import os
import argparse
import json
import torch
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch.utils.data import DataLoader
import pytorch_lightning as pl
from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping
from asteroid.data.wham_dataset import WhamDataset
from system import ... | 46.270968 | 80 | 0.662856 |
1d9041bf824e5b26d87fd04b3790ece2008693f9 | 1,096 | py | Python | core/migrations/0005_auto_20161129_1950.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | core/migrations/0005_auto_20161129_1950.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | core/migrations/0005_auto_20161129_1950.py | vindeolal/pari | 8c69d15101480c3e803d6d74f8007cefee20c350 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailimages.models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20160521_1901'),
]
operations = [
migrations.AlterField(
m... | 42.153846 | 299 | 0.540146 |
4bc4f03059964ea96386465cd73dd3b60195055e | 667 | py | Python | tests/conftest.py | Orhideous/python3_lzo_indexer | aaa6498bb5d3464c36e6103599035028411fb950 | [
"Apache-2.0"
] | 1 | 2020-06-24T13:59:40.000Z | 2020-06-24T13:59:40.000Z | tests/conftest.py | Orhideous/python3_lzo_indexer | aaa6498bb5d3464c36e6103599035028411fb950 | [
"Apache-2.0"
] | 49 | 2018-09-29T23:42:51.000Z | 2021-12-01T18:29:12.000Z | tests/conftest.py | Orhideous/python3_lzo_indexer | aaa6498bb5d3464c36e6103599035028411fb950 | [
"Apache-2.0"
] | null | null | null | from io import BytesIO
from subprocess import Popen, PIPE
import pytest
def lzo_stream(*, length: int = 4096):
"""
Compress a string of null bytes, the length being defined by the
argument to this function.
"""
compressor = Popen(["lzop", "-c"], stdin=PIPE, stdout=PIPE, stderr=PIPE)
stdout, ... | 20.212121 | 76 | 0.674663 |
6c44930a6eb9c414d5c9c37ff5444a21a71e5e39 | 623 | py | Python | app/api_1_0/errors.py | SanbaiWang/sanbaiblog | f78f9f045ff8c4be60ffa4eb8e5074585d5bf93f | [
"MIT"
] | null | null | null | app/api_1_0/errors.py | SanbaiWang/sanbaiblog | f78f9f045ff8c4be60ffa4eb8e5074585d5bf93f | [
"MIT"
] | null | null | null | app/api_1_0/errors.py | SanbaiWang/sanbaiblog | f78f9f045ff8c4be60ffa4eb8e5074585d5bf93f | [
"MIT"
] | 1 | 2020-04-12T00:30:32.000Z | 2020-04-12T00:30:32.000Z | from flask import jsonify
from . import api
from ..exceptions import ValidationError
def bad_request(message):
response = jsonify({'error': 'bad request', 'message': message})
response.status_code = 400
return response
def unauthorized(message):
response = jsonify({'error': 'unauthorized', 'message'... | 23.074074 | 69 | 0.715891 |
eb81be597efaa60c8c136e85df1f43eb6fbe1e8a | 2,704 | py | Python | 3.7.0/lldb-3.7.0.src/test/tools/lldb-mi/symbol/TestMiSymbol.py | androm3da/clang_sles | 2ba6d0711546ad681883c42dfb8661b842806695 | [
"MIT"
] | 3 | 2016-02-10T14:18:40.000Z | 2018-02-05T03:15:56.000Z | 3.7.0/lldb-3.7.0.src/test/tools/lldb-mi/symbol/TestMiSymbol.py | androm3da/clang_sles | 2ba6d0711546ad681883c42dfb8661b842806695 | [
"MIT"
] | 1 | 2016-02-10T15:40:03.000Z | 2016-02-10T15:40:03.000Z | 3.7.0/lldb-3.7.0.src/test/tools/lldb-mi/symbol/TestMiSymbol.py | androm3da/clang_sles | 2ba6d0711546ad681883c42dfb8661b842806695 | [
"MIT"
] | null | null | null | """
Test lldb-mi -symbol-xxx commands.
"""
import lldbmi_testcase
from lldbtest import *
import unittest2
class MiSymbolTestCase(lldbmi_testcase.MiTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
@lldbmi_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
... | 43.612903 | 163 | 0.637574 |
e83b6e42fd0a6376d4bffaca612a330bc961f672 | 5,902 | py | Python | data_analysis/ch04-time-series-visualizer/test_module.py | chaudha4/python-projects | baba3235069b7d6b084f28904f0662c043762175 | [
"MIT"
] | null | null | null | data_analysis/ch04-time-series-visualizer/test_module.py | chaudha4/python-projects | baba3235069b7d6b084f28904f0662c043762175 | [
"MIT"
] | 3 | 2021-11-23T22:19:19.000Z | 2022-03-12T00:52:34.000Z | data_analysis/ch04-time-series-visualizer/test_module.py | chaudha4/python-projects | baba3235069b7d6b084f28904f0662c043762175 | [
"MIT"
] | null | null | null | import unittest
import time_series_visualizer
import matplotlib as mpl
class DataCleaningTestCase(unittest.TestCase):
def test_data_cleaning(self):
actual = int(time_series_visualizer.df.count())
expected = 1238
self.assertEqual(actual, expected, "Expected DataFrame count after cleaning to ... | 47.596774 | 188 | 0.64368 |
a999515a3ca3ae2cb13595e8420fdfea612d93d0 | 15,122 | py | Python | pragmatic/mixins.py | matejhazala/django-pragmatic | 5f46098536ee02093c2cea23a8c574bf99863fa9 | [
"BSD-3-Clause"
] | null | null | null | pragmatic/mixins.py | matejhazala/django-pragmatic | 5f46098536ee02093c2cea23a8c574bf99863fa9 | [
"BSD-3-Clause"
] | null | null | null | pragmatic/mixins.py | matejhazala/django-pragmatic | 5f46098536ee02093c2cea23a8c574bf99863fa9 | [
"BSD-3-Clause"
] | null | null | null | import datetime
import io
import requests
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import PermissionRequiredMixin as DjangoPermissionRequiredMixin, AccessMixin
from django.contrib.contenttypes.models import ContentType
from django.cor... | 36.703883 | 132 | 0.655006 |
c118001dd600a2c5c77f2d1a4981bfb351e81de5 | 3,366 | py | Python | profiles_project/settings.py | rskrobotics/profiles-rest-api | ad24790dbea365b922f4e84a4c09b34802f4539d | [
"MIT"
] | null | null | null | profiles_project/settings.py | rskrobotics/profiles-rest-api | ad24790dbea365b922f4e84a4c09b34802f4539d | [
"MIT"
] | null | null | null | profiles_project/settings.py | rskrobotics/profiles-rest-api | ad24790dbea365b922f4e84a4c09b34802f4539d | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... | 27.818182 | 91 | 0.696078 |
dd350915621691a2f01c3d124ef865b825a19d93 | 5,837 | py | Python | storage/team10/Node.py | itsmjoe/tytus | 3b0341cc854d67979b766c5c8b06ed172ce0c913 | [
"MIT"
] | null | null | null | storage/team10/Node.py | itsmjoe/tytus | 3b0341cc854d67979b766c5c8b06ed172ce0c913 | [
"MIT"
] | null | null | null | storage/team10/Node.py | itsmjoe/tytus | 3b0341cc854d67979b766c5c8b06ed172ce0c913 | [
"MIT"
] | null | null | null | class Node:
def __init__(self):
self.array = []
self.key = -1
self.pk = None
self.isGeneric = False
def insert(self, dato, key):
self.array.append((key,dato)) #ahora recibe el parametro key
lista = self.array.copy()
lista_ordenada= self.quick_sorted... | 32.248619 | 130 | 0.479356 |
7f4613c97f2f1c8e8b1740fd801e0af8c0bccd73 | 720 | py | Python | week3/class3-ex7.py | sh0gunofharlem/PyNetClass | a09bc6dec14f20a726777c107be756752054d935 | [
"Apache-2.0"
] | 1 | 2019-01-29T21:44:43.000Z | 2019-01-29T21:44:43.000Z | week3/class3-ex7.py | sh0gunofharlem/PyNetClass | a09bc6dec14f20a726777c107be756752054d935 | [
"Apache-2.0"
] | null | null | null | week3/class3-ex7.py | sh0gunofharlem/PyNetClass | a09bc6dec14f20a726777c107be756752054d935 | [
"Apache-2.0"
] | null | null | null | import yaml
import re
from ciscoconfparse import CiscoConfParse
from netmiko import ConnectHandler
from getpass import getpass
from pprint import pprint
infile = input("Where is your device list: ")
bgp_config = """
router bgp 44
bgp router-id 10.220.88.38
address-family ipv4 unicast
!
neighbor 10.220.88.20
re... | 18.947368 | 93 | 0.756944 |
328fb94863d5b80cc7d23f6c54f1e975acae1125 | 905 | py | Python | envs/goalgan/ant_maze/ant_maze_env.py | vincentlui/megae | 16b8d29377e3180447b03cb8f5120e9e086ad56d | [
"MIT"
] | 82 | 2020-07-06T16:53:39.000Z | 2022-03-25T18:12:35.000Z | envs/goalgan/ant_maze/ant_maze_env.py | vincentlui/megae | 16b8d29377e3180447b03cb8f5120e9e086ad56d | [
"MIT"
] | 7 | 2020-10-21T21:25:12.000Z | 2022-01-13T02:58:46.000Z | envs/goalgan/ant_maze/ant_maze_env.py | vincentlui/megae | 16b8d29377e3180447b03cb8f5120e9e086ad56d | [
"MIT"
] | 19 | 2020-06-05T23:11:32.000Z | 2022-03-28T08:43:27.000Z | # Copyright 2018 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 applicab... | 36.2 | 80 | 0.692818 |
c1db9facb8407258d245b17c41d9647e6df0fc74 | 3,613 | py | Python | hammer/identification/lambdas/iam-user-inactive-keys-identification/describe_iam_accesskey_details.py | kaiboma/hammer | 674028a067cad91ce1a84577d30afe7b895f2a6a | [
"Apache-2.0"
] | 385 | 2018-07-19T17:19:11.000Z | 2022-03-29T06:54:30.000Z | hammer/identification/lambdas/iam-user-inactive-keys-identification/describe_iam_accesskey_details.py | kaiboma/hammer | 674028a067cad91ce1a84577d30afe7b895f2a6a | [
"Apache-2.0"
] | 33 | 2018-07-31T21:05:06.000Z | 2022-02-26T04:04:07.000Z | hammer/identification/lambdas/iam-user-inactive-keys-identification/describe_iam_accesskey_details.py | kaiboma/hammer | 674028a067cad91ce1a84577d30afe7b895f2a6a | [
"Apache-2.0"
] | 62 | 2018-07-19T17:19:50.000Z | 2022-03-11T15:06:16.000Z | import json
import logging
from library.logger import set_logging
from library.config import Config
from library.aws.iam import IAMKeyChecker
from library.aws.utility import Account, DDB
from library.ddb_issues import IssueStatus, IAMKeyInactiveIssue
from library.ddb_issues import Operations as IssueOperations
def ... | 44.060976 | 143 | 0.659839 |
2a1d0fd6e159052d91a0c59cca97fd274c0bea90 | 2,159 | py | Python | examples/inverted_pendulum.py | zadiq/PILCO | dc809d9d3f11abc5c1ead12caf9da55a738e4a8f | [
"MIT"
] | 1 | 2021-04-11T03:26:06.000Z | 2021-04-11T03:26:06.000Z | examples/inverted_pendulum.py | zadiq/PILCO | dc809d9d3f11abc5c1ead12caf9da55a738e4a8f | [
"MIT"
] | null | null | null | examples/inverted_pendulum.py | zadiq/PILCO | dc809d9d3f11abc5c1ead12caf9da55a738e4a8f | [
"MIT"
] | null | null | null | import numpy as np
import gym
from pilco.models import PILCO
from pilco.controllers import RbfController, LinearController
from pilco.rewards import ExponentialReward
import tensorflow as tf
from tensorflow import logging
np.random.seed(0)
def rollout(policy, timesteps):
X = []; Y = []
env.reset()
x, _, _... | 33.734375 | 99 | 0.660491 |
9bc211833dbd32f6c99013d719a08fc32474b63f | 47,758 | py | Python | src/py/convert_questions.py | mmerveunlu/adversarial-squad | f271bc2d4abe201daeba14f1d9fd960ed376d5a8 | [
"MIT"
] | null | null | null | src/py/convert_questions.py | mmerveunlu/adversarial-squad | f271bc2d4abe201daeba14f1d9fd960ed376d5a8 | [
"MIT"
] | null | null | null | src/py/convert_questions.py | mmerveunlu/adversarial-squad | f271bc2d4abe201daeba14f1d9fd960ed376d5a8 | [
"MIT"
] | null | null | null | """Variety of tools regarding the AddSent adversary."""
import argparse
import collections
import json
import math
import sys
sys.path.insert(0, 'nectar/nectar/corenlp')
from nectar import corenlp
from nltk.corpus import wordnet as wn
from nltk.stem.lancaster import LancasterStemmer
import os
from pattern import en as ... | 37.079193 | 122 | 0.617174 |
bbccaed6e885715ba9b092735656d01ffca34414 | 9,779 | py | Python | venv/lib/python3.8/site-packages/ansible_collections/cisco/ise/plugins/action/guest_smtp_notification_settings.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_collections/cisco/ise/plugins/action/guest_smtp_notification_settings.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_collections/cisco/ise/plugins/action/guest_smtp_notification_settings.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
try:
... | 39.431452 | 128 | 0.615809 |
e7ebd6d274963cfb3a9fffe8945b32c19bf764ff | 4,598 | py | Python | scripts/portable/Base.py | zero-tomoya/Base | 084de907994679853d47b1e4ab26232f857ca1df | [
"MIT"
] | null | null | null | scripts/portable/Base.py | zero-tomoya/Base | 084de907994679853d47b1e4ab26232f857ca1df | [
"MIT"
] | null | null | null | scripts/portable/Base.py | zero-tomoya/Base | 084de907994679853d47b1e4ab26232f857ca1df | [
"MIT"
] | null | null | null |
import tkinter
import copy
import sys,pickle
from tkinter import messagebox
from tkinter import ttk
import os
import time
import webbrowser
import traceback
import threading
import tkinter.font as tkFont
import configparser
import datetime
# this Softwere Defalut browser is keyword search
s=0
print('')
print(' simpl... | 28.208589 | 108 | 0.609613 |
766ab63c5695f797ad56971ebb315218bcfeb1db | 11,866 | py | Python | mozillians/users/migrations/0046_rename_externalaccount_username_identifier.py | caktus/mozillians | 312eb5d993b60092fa4f8eb94548c1db4b21fa01 | [
"BSD-3-Clause"
] | null | null | null | mozillians/users/migrations/0046_rename_externalaccount_username_identifier.py | caktus/mozillians | 312eb5d993b60092fa4f8eb94548c1db4b21fa01 | [
"BSD-3-Clause"
] | null | null | null | mozillians/users/migrations/0046_rename_externalaccount_username_identifier.py | caktus/mozillians | 312eb5d993b60092fa4f8eb94548c1db4b21fa01 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.rename_column('users_externalaccount', 'username', 'identifier')
def backwards(self, orm):
db.rename... | 82.979021 | 226 | 0.5627 |
bbf8018bdb718ad770572bce6f5759f71fd37640 | 20,177 | py | Python | Link_prediction_baseline/models/dgi.py | amazon-research/gnn-tail-generalization | 1ff49e62b8a2e2a7273c50dce59167ea9d9161fb | [
"Apache-2.0"
] | 15 | 2021-11-03T22:06:16.000Z | 2022-03-26T06:56:48.000Z | Link_prediction_baseline/models/dgi.py | amazon-research/gnn-tail-generalization | 1ff49e62b8a2e2a7273c50dce59167ea9d9161fb | [
"Apache-2.0"
] | 1 | 2022-02-22T16:11:27.000Z | 2022-03-01T07:09:35.000Z | Link_prediction_baseline/models/dgi.py | amazon-research/gnn-tail-generalization | 1ff49e62b8a2e2a7273c50dce59167ea9d9161fb | [
"Apache-2.0"
] | 3 | 2022-01-08T09:58:15.000Z | 2022-03-21T22:43:16.000Z | import numpy
from pypapi import events, papi_high as high
high.start_counters([events.PAPI_FP_OPS, ])
for n in [10, 30, 100, 300, 1000, 10000, 20000]:
aa = numpy.mgrid[0:n:1, 0:n:1][0]
high.start_counters([events.PAPI_FP_OPS, ])
a = numpy.fft.fft(aa)
x = high.stop_counters()
print(n, x)
... | 37.643657 | 115 | 0.571839 |
f9aa2a42949bbee001ce3a776d918cc2565fa6cf | 2,526 | py | Python | azureml/data.py | ajansenn/BRUVNet | 68d905929902787c9986ecc41adcd46f07a4551e | [
"MIT"
] | 4 | 2021-10-07T00:29:58.000Z | 2022-01-14T00:26:17.000Z | azureml/data.py | ajansenn/BRUVNet | 68d905929902787c9986ecc41adcd46f07a4551e | [
"MIT"
] | null | null | null | azureml/data.py | ajansenn/BRUVNet | 68d905929902787c9986ecc41adcd46f07a4551e | [
"MIT"
] | null | null | null | import numpy as np
import os
import torch.utils.data
from azureml.core import Run
from PIL import Image
class KakaduFishDataset(torch.utils.data.Dataset):
def __init__(self, root, transforms=None):
self.root = root
self.transforms = transforms
# load all image files, sorting them to ensu... | 32.384615 | 76 | 0.593428 |
ff6e8f84ed3e2778b91a1466c357a12931d0410c | 1,022 | py | Python | returns/_generated/pipeline/pipe.py | seancrwhite/returns | 1350beb3ece388d1b7e3a2a529ddd7c984fe74ca | [
"BSD-2-Clause"
] | null | null | null | returns/_generated/pipeline/pipe.py | seancrwhite/returns | 1350beb3ece388d1b7e3a2a529ddd7c984fe74ca | [
"BSD-2-Clause"
] | 1 | 2020-07-13T23:12:58.000Z | 2020-07-13T23:12:58.000Z | returns/_generated/pipeline/pipe.py | seancrwhite/returns | 1350beb3ece388d1b7e3a2a529ddd7c984fe74ca | [
"BSD-2-Clause"
] | null | null | null | from returns._generated.pipeline.flow import _flow
def _pipe(*functions):
"""
Allows to compose a value and up to 7 functions that use this value.
We use a custom ``mypy`` plugin to make sure types are correct.
Otherwise, it is currently impossible to properly type this function.
Each next funct... | 29.2 | 73 | 0.64775 |
38e48ebd111edf21f197b04e49512a59689feb65 | 1,765 | py | Python | python/oneflow/test/modules/test_matmul.py | LiPengze97/oneflow | 1c1d2d3faa1c02d20e009046a290cf1095ee12e0 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_matmul.py | LiPengze97/oneflow | 1c1d2d3faa1c02d20e009046a290cf1095ee12e0 | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_matmul.py | LiPengze97/oneflow | 1c1d2d3faa1c02d20e009046a290cf1095ee12e0 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 32.090909 | 72 | 0.713881 |
9b8db524584369acb50eadbf2c9e09b08a4273a5 | 1,373 | py | Python | python/107_Binary_Tree_Level_Order_Traversal_II.py | dvlpsh/leetcode-1 | f965328af72113ac8a5a9d6624868c1502be937b | [
"MIT"
] | 4,416 | 2016-03-30T15:02:26.000Z | 2022-03-31T16:31:03.000Z | python/107_Binary_Tree_Level_Order_Traversal_II.py | YinpuLi/leetcode-6 | 1371de2631d745efba39de41b51c3424e35da434 | [
"MIT"
] | 20 | 2018-11-17T13:46:25.000Z | 2022-03-13T05:37:06.000Z | python/107_Binary_Tree_Level_Order_Traversal_II.py | YinpuLi/leetcode-6 | 1371de2631d745efba39de41b51c3424e35da434 | [
"MIT"
] | 1,374 | 2017-05-26T15:44:30.000Z | 2022-03-30T19:21:02.000Z | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
# def levelOrderBottom(self, root):
# """
# :type root: TreeNode
# :rtype: List[List[int]]
# ... | 29.212766 | 52 | 0.463948 |
f0e7007553a4ea303e2d2886a38f6caa01475fe1 | 4,697 | py | Python | airflow/dags/training.py | msstoci/airflow-mastoci | 8195f25ae235dfff832fc84cee6a2f0f862bfa66 | [
"Apache-2.0"
] | null | null | null | airflow/dags/training.py | msstoci/airflow-mastoci | 8195f25ae235dfff832fc84cee6a2f0f862bfa66 | [
"Apache-2.0"
] | null | null | null | airflow/dags/training.py | msstoci/airflow-mastoci | 8195f25ae235dfff832fc84cee6a2f0f862bfa66 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 28.640244 | 84 | 0.729615 |
c84c20d6622cefbcf41b7dfcd5b6f6c7eea7a232 | 1,933 | py | Python | test/pytest_t_tools_densedm.py | Tomographer/tomographer | 0a64927e639454175803c1746141bd9288af8b29 | [
"MIT"
] | 12 | 2015-09-24T02:25:11.000Z | 2020-02-13T02:26:00.000Z | test/pytest_t_tools_densedm.py | Tomographer/tomographer | 0a64927e639454175803c1746141bd9288af8b29 | [
"MIT"
] | 4 | 2015-10-12T15:48:55.000Z | 2021-07-21T15:14:59.000Z | test/pytest_t_tools_densedm.py | Tomographer/tomographer | 0a64927e639454175803c1746141bd9288af8b29 | [
"MIT"
] | 2 | 2015-10-12T15:32:29.000Z | 2018-05-08T11:39:49.000Z | #!/usr/bin/env python
from __future__ import print_function
import re
import numpy as np
import numpy.testing as npt
import logging
logging.basicConfig(level=logging.DEBUG)
import unittest
# import the module
import tomographer.tools.densedm
import tomographer.tools.densedm.mle
import tomographer
import tomographe... | 28.014493 | 84 | 0.619762 |
b90220e8421213508fee9d1331569e5e8893d9c6 | 8,515 | py | Python | Tests/Methods/Slot/test_SlotM15_meth.py | ajpina/pyleecan | f8d1fce7d108cf443f5767e35d59ff15905fb49f | [
"Apache-2.0"
] | null | null | null | Tests/Methods/Slot/test_SlotM15_meth.py | ajpina/pyleecan | f8d1fce7d108cf443f5767e35d59ff15905fb49f | [
"Apache-2.0"
] | null | null | null | Tests/Methods/Slot/test_SlotM15_meth.py | ajpina/pyleecan | f8d1fce7d108cf443f5767e35d59ff15905fb49f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from pyleecan.Classes.LamSlotMag import LamSlotMag
from pyleecan.Classes.SlotM15 import SlotM15
from numpy import pi, exp, sqrt, arcsin, angle
from pyleecan.Methods.Slot.Slot.comp_height import comp_height
from pyleecan.Methods.Slot.Slot.comp_surface import comp_surface
from pyle... | 36.861472 | 87 | 0.617733 |
f2abb85e214cf39ae68448ddeb4063154ffcf547 | 467 | py | Python | data/scripts/templates/object/building/poi/shared_dathomir_imperialprisonpatrol_large2.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/building/poi/shared_dathomir_imperialprisonpatrol_large2.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/building/poi/shared_dathomir_imperialprisonpatrol_large2.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 = Building()
result.template = "object/building/poi/shared_dathomir_imperialprisonpatrol_large2.iff"
result.attribu... | 27.470588 | 88 | 0.738758 |
287e216efc28d7dd79afb1b5b4eaf04f26f984b8 | 6,121 | py | Python | ajax_filtered_fields/forms/widgets.py | bisio/django-ajax-filtered-fields | a80f25c79a8564b942690408493d245fd84c2782 | [
"MIT"
] | null | null | null | ajax_filtered_fields/forms/widgets.py | bisio/django-ajax-filtered-fields | a80f25c79a8564b942690408493d245fd84c2782 | [
"MIT"
] | null | null | null | ajax_filtered_fields/forms/widgets.py | bisio/django-ajax-filtered-fields | a80f25c79a8564b942690408493d245fd84c2782 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import operator
from django.conf import settings
from django import forms
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from ajax_filtered_fields import utils
def _renderFilter(js_method_name, element_id, model, lookup_list,
select_relat... | 36.652695 | 96 | 0.523117 |
16f63f7f538d9931cf963117243553de6d78c183 | 2,508 | py | Python | run_worker.py | SaneBow/AttentionAgentCarRacing | 944dc18b99b2c51a25c206f722a0bbc43cb7bbb0 | [
"Apache-2.0"
] | 1 | 2020-12-05T13:42:51.000Z | 2020-12-05T13:42:51.000Z | run_worker.py | SaneBow/AttentionAgentCarRacing | 944dc18b99b2c51a25c206f722a0bbc43cb7bbb0 | [
"Apache-2.0"
] | null | null | null | run_worker.py | SaneBow/AttentionAgentCarRacing | 944dc18b99b2c51a25c206f722a0bbc43cb7bbb0 | [
"Apache-2.0"
] | null | null | null | import argparse
import protobuf.roll_out_service_pb2_grpc
import gin
import grpc
import time
import misc.utility
from concurrent import futures
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
_MAX_MSG_LEN = 40 * 1024 * 1024
def main(config):
"""Start the worker."""
gin.parse_config_file(config.config)
logger = misc... | 33.44 | 109 | 0.67185 |
5e293d993be0b87c2547741c4d0d9ae7155e1670 | 502 | py | Python | scripts/eval.py | milebril/Temporal-SBMC-extension | 57c56b73786e49d233facffde4ba80f212a00fa8 | [
"Apache-2.0"
] | null | null | null | scripts/eval.py | milebril/Temporal-SBMC-extension | 57c56b73786e49d233facffde4ba80f212a00fa8 | [
"Apache-2.0"
] | null | null | null | scripts/eval.py | milebril/Temporal-SBMC-extension | 57c56b73786e49d233facffde4ba80f212a00fa8 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('output/emil/dataviz_sequence/denoised/peters/-peters-scene-0_frame-0.png',0)
f = np.fft.fft2(img)
fshift = np.fft.fftshift(f)
magnitude_spectrum = 20*np.log(np.abs(fshift))
plt.subplot(121),plt.imshow(img, cmap = 'gray')
plt.title('I... | 35.857143 | 94 | 0.729084 |
b989fa204cc2773a1e7e84de34da2336805f6da6 | 1,523 | py | Python | gameoflife/modal/screen.py | hnrkcode/game-of-life | 7fa948bc788bcb3f1d21a5720ebf1a84fd0b512e | [
"MIT"
] | 5 | 2020-10-10T13:53:36.000Z | 2021-05-26T13:01:24.000Z | gameoflife/modal/screen.py | hnrkcode/game-of-life | 7fa948bc788bcb3f1d21a5720ebf1a84fd0b512e | [
"MIT"
] | null | null | null | gameoflife/modal/screen.py | hnrkcode/game-of-life | 7fa948bc788bcb3f1d21a5720ebf1a84fd0b512e | [
"MIT"
] | null | null | null | import math
import pygame
from gameoflife import settings
from gameoflife.util.text import InfoText
class ScreenText(pygame.sprite.Sprite):
def __init__(self, text):
super().__init__()
self.text = self.set_text(text)
self.color = settings.OVERLAY_COLOR
self.image = pygame.Surface(... | 29.288462 | 86 | 0.607354 |
f385c8cb906b59d3a34c21aa210c6511c9be268b | 11,064 | bzl | Python | third_party/py/python_configure.bzl | efc-robot/cyberRT | c0e63539cf97030c64545d87c203d4e457d481ca | [
"Apache-2.0"
] | 41 | 2020-12-07T07:32:02.000Z | 2022-01-18T09:14:59.000Z | third_party/py/python_configure.bzl | efc-robot/cyberRT | c0e63539cf97030c64545d87c203d4e457d481ca | [
"Apache-2.0"
] | 4 | 2021-01-05T02:53:46.000Z | 2021-11-05T08:35:46.000Z | third_party/py/python_configure.bzl | efc-robot/cyberRT | c0e63539cf97030c64545d87c203d4e457d481ca | [
"Apache-2.0"
] | 28 | 2020-12-06T08:01:38.000Z | 2022-03-10T08:14:01.000Z | # Adapted with modifications from tensorflow/third_party/py/
"""Repository rule for Python autoconfiguration.
`python_configure` depends on the following environment variables:
* `PYTHON_BIN_PATH`: location of python binary.
* `PYTHON_LIB_PATH`: Location of python libraries.
"""
load("//tools/bazel:common.bzl", ... | 35.12381 | 85 | 0.611714 |
d0faf977fe1fad080be5eedd70ebc62247064411 | 4,541 | py | Python | xtlib/cache_client.py | microsoft/ExperimentTools | ea9c15899dc787d8fbaf87dc4e9849ec4b28aadc | [
"MIT"
] | 5 | 2020-06-13T17:44:51.000Z | 2021-12-21T21:02:36.000Z | xtlib/cache_client.py | microsoft/ExperimentTools | ea9c15899dc787d8fbaf87dc4e9849ec4b28aadc | [
"MIT"
] | 9 | 2020-06-11T20:56:52.000Z | 2022-03-12T00:34:45.000Z | xtlib/cache_client.py | microsoft/ExperimentTools | ea9c15899dc787d8fbaf87dc4e9849ec4b28aadc | [
"MIT"
] | 7 | 2020-06-13T17:44:54.000Z | 2021-12-21T21:02:52.000Z | #
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
#
# cache_client.py: handles the caching of credehntials for the XT client
import os
import ssl
import sys
import time
import json
import socket
import logging
from xtlib import utils
from xtlib import console
from xtlib import pc_utils
from xt... | 35.476563 | 121 | 0.595464 |
581fba0b855e09ef3d8d6350d1f2abf810ed3f0e | 457 | py | Python | drf_email_project/users/migrations/0009_emailuser_avatar.py | liquanhui01/drf_email_user | 188ecc3e36edb190cc1cd8f908d3b72c42d49301 | [
"MIT"
] | null | null | null | drf_email_project/users/migrations/0009_emailuser_avatar.py | liquanhui01/drf_email_user | 188ecc3e36edb190cc1cd8f908d3b72c42d49301 | [
"MIT"
] | null | null | null | drf_email_project/users/migrations/0009_emailuser_avatar.py | liquanhui01/drf_email_user | 188ecc3e36edb190cc1cd8f908d3b72c42d49301 | [
"MIT"
] | 1 | 2021-11-15T08:23:13.000Z | 2021-11-15T08:23:13.000Z | # Generated by Django 3.1.4 on 2020-12-04 09:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0008_auto_20201204_1704'),
]
operations = [
migrations.AddField(
model_name='emailuser',
name='avatar',
... | 24.052632 | 122 | 0.61488 |
ce4007f22385e52ddce2407a51d63c1871e88bcc | 6,340 | py | Python | tests/profiler_test.py | sudhakarsingh27/jax | 5afb5a6e5b1ddf29b55bdd30442022190e25529c | [
"Apache-2.0"
] | null | null | null | tests/profiler_test.py | sudhakarsingh27/jax | 5afb5a6e5b1ddf29b55bdd30442022190e25529c | [
"Apache-2.0"
] | 6 | 2022-01-03T23:12:33.000Z | 2022-02-14T23:13:52.000Z | tests/profiler_test.py | sudhakarsingh27/jax | 5afb5a6e5b1ddf29b55bdd30442022190e25529c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.512821 | 79 | 0.673817 |
4c967f73676f63ec6a0992961018f7aa503fe8ca | 905 | py | Python | tests/test_http_input.py | giannisdoukas/cwltool | 5a29b0742b8387f1ce8fc11e9b408a3b636432ee | [
"Apache-2.0"
] | null | null | null | tests/test_http_input.py | giannisdoukas/cwltool | 5a29b0742b8387f1ce8fc11e9b408a3b636432ee | [
"Apache-2.0"
] | null | null | null | tests/test_http_input.py | giannisdoukas/cwltool | 5a29b0742b8387f1ce8fc11e9b408a3b636432ee | [
"Apache-2.0"
] | null | null | null | import os
import tempfile
from typing import List
from cwltool.pathmapper import PathMapper
from cwltool.utils import CWLObjectType
def test_http_path_mapping() -> None:
input_file_path = "https://raw.githubusercontent.com/common-workflow-language/cwltool/main/tests/2.fasta"
tempdir = tempfile.mkdtemp()
... | 31.206897 | 112 | 0.688398 |
d03bbe026817cef36499c0a77050247c7de5fcd6 | 2,770 | py | Python | tests/test_boxes.py | lycantropos/hypothesis_geometry | 23e1638144ffba089eee21eb623b0499713e0b1c | [
"MIT"
] | 9 | 2020-01-16T13:52:16.000Z | 2022-03-16T00:01:26.000Z | tests/test_boxes.py | lycantropos/hypothesis_geometry | 23e1638144ffba089eee21eb623b0499713e0b1c | [
"MIT"
] | 38 | 2020-01-16T12:08:51.000Z | 2021-01-11T11:06:32.000Z | tests/test_boxes.py | lycantropos/hypothesis_geometry | 23e1638144ffba089eee21eb623b0499713e0b1c | [
"MIT"
] | 1 | 2020-03-12T10:29:44.000Z | 2020-03-12T10:29:44.000Z | from typing import Tuple
from ground.hints import Scalar
from hypothesis import given
from hypothesis.strategies import DataObject
from hypothesis_geometry.hints import Strategy
from hypothesis_geometry.planar import boxes
from tests import strategies
from tests.utils import (ScalarsLimitsType,
... | 36.933333 | 74 | 0.598556 |
d984984f11834466ffad31177ad657fbbf1f3ca6 | 8,012 | py | Python | test/functional/wallet_backup.py | barrystyle/nyc3 | 43a15d192e23602d2d5d97d458efbc1cb7a4da7d | [
"MIT"
] | 1 | 2019-06-06T22:44:39.000Z | 2019-06-06T22:44:39.000Z | test/functional/wallet_backup.py | barrystyle/nyc3 | 43a15d192e23602d2d5d97d458efbc1cb7a4da7d | [
"MIT"
] | null | null | null | test/functional/wallet_backup.py | barrystyle/nyc3 | 43a15d192e23602d2d5d97d458efbc1cb7a4da7d | [
"MIT"
] | 3 | 2019-06-05T22:50:07.000Z | 2021-04-19T22:59:55.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The NYC3 Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet backup features.
Test case is:
4 nodes. 1 2 and 3 send transactions between each other,
f... | 37.971564 | 147 | 0.651023 |
f7522d2ca321ae026aceeb862d016255fdc67539 | 684 | py | Python | integrations/airflow/marquez_airflow/__init__.py | ravwojdyla/marquez | 8636604e5dcffe1832ea39d9b72e9bbab7b272db | [
"Apache-2.0"
] | null | null | null | integrations/airflow/marquez_airflow/__init__.py | ravwojdyla/marquez | 8636604e5dcffe1832ea39d9b72e9bbab7b272db | [
"Apache-2.0"
] | null | null | null | integrations/airflow/marquez_airflow/__init__.py | ravwojdyla/marquez | 8636604e5dcffe1832ea39d9b72e9bbab7b272db | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 34.2 | 74 | 0.739766 |
d77a8995e54efd87653ce25836b10892a2015f2b | 674 | py | Python | restaurant_project/manage.py | lukart80/restaurant | 419786cd87a7bd15c82b2fda8ad7c5e3e1f6c9cd | [
"MIT"
] | null | null | null | restaurant_project/manage.py | lukart80/restaurant | 419786cd87a7bd15c82b2fda8ad7c5e3e1f6c9cd | [
"MIT"
] | null | null | null | restaurant_project/manage.py | lukart80/restaurant | 419786cd87a7bd15c82b2fda8ad7c5e3e1f6c9cd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'restaurant_project.settings')
try:
from django.core.management import execute_from_command_line
... | 29.304348 | 82 | 0.683976 |
7719d55eab9700c1a48e9c68b7305e7ea92336b5 | 12,492 | py | Python | HDPython/ast/AST_member_function_converter.py | HardwareDesignWithPython/HDPython | aade03aaa092b1684fa12bffd17674cf1c45f5ac | [
"MIT"
] | null | null | null | HDPython/ast/AST_member_function_converter.py | HardwareDesignWithPython/HDPython | aade03aaa092b1684fa12bffd17674cf1c45f5ac | [
"MIT"
] | null | null | null | HDPython/ast/AST_member_function_converter.py | HardwareDesignWithPython/HDPython | aade03aaa092b1684fa12bffd17674cf1c45f5ac | [
"MIT"
] | 1 | 2021-10-20T20:08:16.000Z | 2021-10-20T20:08:16.000Z | import functools
import copy
import HDPython.hdl_converter as hdl
from HDPython.base import print_cnvt, gTemplateIndent, v_deepcopy
from HDPython.lib_enums import getDefaultVarSig ,setDefaultVarSig, varSig, InOut_t
from HDPython.base_helpers import join_str
from HDPython.v_function import v_procedure, v_function ,v_... | 34.991597 | 181 | 0.603026 |
8b711a4790de04eee948de5630d49dc0f23e306b | 33,077 | py | Python | test/functional/rpc_fundrawtransaction.py | CoinBitCore/temp | a2ebefc861aa979b441286a203d574197459b0d6 | [
"MIT"
] | null | null | null | test/functional/rpc_fundrawtransaction.py | CoinBitCore/temp | a2ebefc861aa979b441286a203d574197459b0d6 | [
"MIT"
] | null | null | null | test/functional/rpc_fundrawtransaction.py | CoinBitCore/temp | a2ebefc861aa979b441286a203d574197459b0d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Coinbit Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the fundrawtransaction RPC."""
from test_framework.test_framework import CoinbitTestFramework
fro... | 45.125512 | 223 | 0.569429 |
b161f44162e000d2c8cab324757d9f5fc2cda976 | 4,100 | py | Python | setup.py | cisagov/assessment-data-import | 767141c276494879db0f73f9fe2465f0250c38cc | [
"CC0-1.0"
] | 2 | 2021-03-18T23:20:34.000Z | 2022-02-03T04:36:29.000Z | setup.py | cisagov/assessment-data-import-lambda | 767141c276494879db0f73f9fe2465f0250c38cc | [
"CC0-1.0"
] | 7 | 2019-12-05T14:18:34.000Z | 2021-08-10T17:14:39.000Z | setup.py | cisagov/assessment-data-import | 767141c276494879db0f73f9fe2465f0250c38cc | [
"CC0-1.0"
] | 1 | 2021-06-04T23:39:05.000Z | 2021-06-04T23:39:05.000Z | """
This is the setup module for assessment data import.
Based on:
- https://packaging.python.org/distributing/
- https://github.com/pypa/sampleproject/blob/master/setup.py
- https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure
"""
# Standard Python Libraries
import codecs
from glob import glob
from os... | 38.679245 | 94 | 0.653659 |
fd2c919be04a6b400863f7e01031223eeca9f7fb | 1,162 | py | Python | src/pretalx/common/forms/validators.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | src/pretalx/common/forms/validators.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | src/pretalx/common/forms/validators.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from zxcvbn import zxcvbn
class ZXCVBNValidator:
code = 'password_too_weak'
DEFAULT_USER_ATTRIBUTES = ('username', 'first_name', 'last_name', 'email')
def __init__(self, min_score=3, user_attributes... | 40.068966 | 92 | 0.681583 |
72a62a082a2b6d6c71d7fdbe2c17a641627a74b5 | 1,706 | py | Python | setup.py | Relrin/sanic-base-extension | e5e6be3572ad52a8fab2565da6e64422d556ade3 | [
"BSD-3-Clause"
] | 4 | 2018-12-06T08:59:26.000Z | 2021-08-25T11:24:56.000Z | setup.py | Relrin/sanic-base-extension | e5e6be3572ad52a8fab2565da6e64422d556ade3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | Relrin/sanic-base-extension | e5e6be3572ad52a8fab2565da6e64422d556ade3 | [
"BSD-3-Clause"
] | 1 | 2020-09-28T01:21:59.000Z | 2020-09-28T01:21:59.000Z | # -*- coding: utf-8 -*-
import os
import re
import ast
from setuptools import setup
_version_re = re.compile(r'__version__\s+=\s+(.*)')
requirements = []
with open('sanic_base_ext/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
def read... | 28.433333 | 74 | 0.639508 |
af888a7a508f7aa401a3a5870ebd1db9e34ce605 | 538 | py | Python | dbsp_drp/gui_helpers.py | finagle29/DBSP_DRP | d2f869f85e1425507dbc84e4e76fa44a6784f9d1 | [
"BSD-3-Clause"
] | 1 | 2021-05-17T23:28:25.000Z | 2021-05-17T23:28:25.000Z | dbsp_drp/gui_helpers.py | finagle29/DBSP_DRP | d2f869f85e1425507dbc84e4e76fa44a6784f9d1 | [
"BSD-3-Clause"
] | 23 | 2020-12-14T17:25:13.000Z | 2022-02-23T09:30:10.000Z | dbsp_drp/gui_helpers.py | finagle29/DBSP_DRP | d2f869f85e1425507dbc84e4e76fa44a6784f9d1 | [
"BSD-3-Clause"
] | null | null | null | """
Module for classes and functions shared between GUIs.
"""
from matplotlib.backend_tools import ToolBase
from PySide2 import QtWidgets
class HelpTool(ToolBase):
"""
Print help text.
"""
# keyboard shortcut
default_keymap = 'h'
description = 'Help'
image = 'help'
def __init__(self, ... | 23.391304 | 70 | 0.654275 |
89037ce17a7bb60912a30f33436ba1596d396f18 | 6,339 | py | Python | modules/steps/base_pipeline_step.py | KTH/aspen | 3be9b55d21dfd950d1a82b2cf4f464cd1f1e9757 | [
"MIT"
] | null | null | null | modules/steps/base_pipeline_step.py | KTH/aspen | 3be9b55d21dfd950d1a82b2cf4f464cd1f1e9757 | [
"MIT"
] | 8 | 2019-10-10T08:03:02.000Z | 2022-01-11T11:28:58.000Z | modules/steps/base_pipeline_step.py | KTH/aspen | 3be9b55d21dfd950d1a82b2cf4f464cd1f1e9757 | [
"MIT"
] | null | null | null | """BasePipelineStep
Base class for all other pipeline steps. Wraps step running,
environment and step data verification, step chaining and
handles logging and exceptions"""
__author__ = 'tinglev'
#from memory_profiler import profile
from abc import ABCMeta, abstractmethod
import time
import os
import logging
from lo... | 41.431373 | 97 | 0.661619 |
988f57cf6ea7f1065eea4e27336cbc5040c5ae17 | 523 | py | Python | test_patient_gui.py | adamkrekorian/Patient-Monitoring-Station-BME547 | 8bab434464b106fe2ae1751bcdcbc93b6da4995f | [
"Unlicense"
] | null | null | null | test_patient_gui.py | adamkrekorian/Patient-Monitoring-Station-BME547 | 8bab434464b106fe2ae1751bcdcbc93b6da4995f | [
"Unlicense"
] | null | null | null | test_patient_gui.py | adamkrekorian/Patient-Monitoring-Station-BME547 | 8bab434464b106fe2ae1751bcdcbc93b6da4995f | [
"Unlicense"
] | null | null | null | import base64
import io
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
def test_file_to_b64_string():
""" Tests image encoder function
The test_file_to_b64_string() function tests the ability of the image
encoder function to encode an input image file into a base64 byte string.
... | 24.904762 | 77 | 0.745698 |
ca38b25aef297a478abca4abd095db88c88a3bf2 | 11,035 | py | Python | instabot/bot/bot_get.py | bundle-marketing/instabot | d261e5edc475ece685f4184ca715842e34b512f4 | [
"Apache-2.0"
] | null | null | null | instabot/bot/bot_get.py | bundle-marketing/instabot | d261e5edc475ece685f4184ca715842e34b512f4 | [
"Apache-2.0"
] | null | null | null | instabot/bot/bot_get.py | bundle-marketing/instabot | d261e5edc475ece685f4184ca715842e34b512f4 | [
"Apache-2.0"
] | null | null | null | """
All methods must return media_ids that can be
passed into e.g. like() or comment() functions.
"""
from tqdm import tqdm
def get_media_owner(self, media_id):
self.api.media_info(media_id)
try:
return str(self.api.last_json["items"][0]["user"]["pk"])
except Exception as ex:
self... | 34.270186 | 88 | 0.63072 |
c6b8f0f12a77ad0f5338da3b7b09775841958249 | 12,012 | py | Python | forte/data/readers/html_reader.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | forte/data/readers/html_reader.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | forte/data/readers/html_reader.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Forte 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 applicable ... | 38.012658 | 80 | 0.507992 |
2451d6fde78a2952dc1ae08414282787b178b11c | 1,241 | py | Python | Baekjoon/Greedy/11399_ATM.py | Gonnnnn/Algorithm | f9cbbbc64e5d62ed75a5e3d5edb7b8cdae6e18e2 | [
"Apache-2.0"
] | null | null | null | Baekjoon/Greedy/11399_ATM.py | Gonnnnn/Algorithm | f9cbbbc64e5d62ed75a5e3d5edb7b8cdae6e18e2 | [
"Apache-2.0"
] | null | null | null | Baekjoon/Greedy/11399_ATM.py | Gonnnnn/Algorithm | f9cbbbc64e5d62ed75a5e3d5edb7b8cdae6e18e2 | [
"Apache-2.0"
] | null | null | null | # 문제
# 인하은행에는 ATM이 1대밖에 없다. 지금 이 ATM앞에 N명의 사람들이 줄을 서있다. 사람은 1번부터 N번까지 번호가 매겨져 있으며, i번 사람이 돈을 인출하는데 걸리는 시간은 Pi분이다.
# 사람들이 줄을 서는 순서에 따라서, 돈을 인출하는데 필요한 시간의 합이 달라지게 된다. 예를 들어, 총 5명이 있고, P1 = 3, P2 = 1, P3 = 4, P4 = 3, P5 = 2 인 경우를 생각해보자. [1, 2, 3, 4, 5] 순서로 줄을 선다면, 1번 사람은 3분만에 돈을 뽑을 수 있다. 2번 사람은 1번 사람이 돈을 뽑을 때 까지 기다려야 하기 ... | 40.032258 | 400 | 0.628525 |
058f2c38f5d13c7b7b776fc51c772db54182ea04 | 380 | py | Python | cmlkit/utility/__init__.py | sirmarcel/cmlk | e099bf3e255b60675e8e1b3ad29db750dbd6faf3 | [
"MIT"
] | 24 | 2018-06-22T17:31:20.000Z | 2022-03-29T14:52:49.000Z | cmlkit/utility/__init__.py | sirmarcel/cmlk | e099bf3e255b60675e8e1b3ad29db750dbd6faf3 | [
"MIT"
] | 8 | 2019-06-06T14:51:57.000Z | 2021-06-30T19:43:13.000Z | cmlkit/utility/__init__.py | sirmarcel/cmlk | e099bf3e255b60675e8e1b3ad29db750dbd6faf3 | [
"MIT"
] | 5 | 2018-07-30T18:53:08.000Z | 2022-02-10T09:12:15.000Z | """Kitchen sink of various convenient things."""
from .elements import charges_to_elements
from .timing import timed, time_repeat
from .conversion import convert, unconvert
from .indices import fourway_split, threeway_split, twoway_split
from .humanhash import humanize
from .opt_lgs import OptimizerLGS
from .import_qm... | 38 | 74 | 0.844737 |
fa29e8513dd838cdea3972e233757eea995260ea | 4,911 | py | Python | Scientific Computing with Python/Shape Calculator/test_module.py | SassoStark/FreeCodeCamp | d6510de402436ed3560734c5f333272fa6fd64d8 | [
"MIT"
] | null | null | null | Scientific Computing with Python/Shape Calculator/test_module.py | SassoStark/FreeCodeCamp | d6510de402436ed3560734c5f333272fa6fd64d8 | [
"MIT"
] | null | null | null | Scientific Computing with Python/Shape Calculator/test_module.py | SassoStark/FreeCodeCamp | d6510de402436ed3560734c5f333272fa6fd64d8 | [
"MIT"
] | null | null | null | import unittest
import shape_calculator
class UnitTests(unittest.TestCase):
def setUp(self):
self.rect = shape_calculator.Rectangle(3, 6)
self.sq = shape_calculator.Square(5)
def test_subclass(self):
actual = issubclass(shape_calculator.Square, shape_calculator.Rectangle)
expe... | 42.336207 | 151 | 0.669721 |
ae66e537af960a0ea5f727d27cd128a65e3efd9a | 1,223 | py | Python | aliyun-python-sdk-cs/aliyunsdkcs/request/v20151215/DescribeClusterDetailRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cs/aliyunsdkcs/request/v20151215/DescribeClusterDetailRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cs/aliyunsdkcs/request/v20151215/DescribeClusterDetailRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.21875 | 78 | 0.764513 |
3ec3ca850eec92eb1dbabff6750e577feb1a1272 | 101,758 | py | Python | jadrian.py | jskDr/jamespy | 729c496732d8ec2d6ba25d6b97ef2aa02065c18c | [
"MIT"
] | null | null | null | jadrian.py | jskDr/jamespy | 729c496732d8ec2d6ba25d6b97ef2aa02065c18c | [
"MIT"
] | null | null | null | jadrian.py | jskDr/jamespy | 729c496732d8ec2d6ba25d6b97ef2aa02065c18c | [
"MIT"
] | null | null | null | """
adrin_rp.py
This file collects functions and classes used in Redox potential prediction in metabolism,
which I am collaborating with Adrian.
"""
import numpy as np
import pandas as pd
from collections import OrderedDict
# Optimization codes are described
from sklearn import cross_validation
from scipy.optimize ... | 31.621504 | 169 | 0.605122 |
b89af081a47b08708cbf3950347e63ed8178ba4a | 5,977 | py | Python | sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/_models.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 3 | 2020-06-23T02:25:27.000Z | 2021-09-07T18:48:11.000Z | sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/_models.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 510 | 2019-07-17T16:11:19.000Z | 2021-08-02T08:38:32.000Z | sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2018_09_01_preview/models/_models.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | 5 | 2019-09-04T12:51:37.000Z | 2020-09-16T07:28:40.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 may ... | 38.811688 | 99 | 0.643467 |
24059e5e903b8a9604208fdcf49bced8f677f07f | 3,536 | py | Python | utils/dataset_collection/airsim/airsim_fly.py | surirohit/multi-camera-deeptam | 37288ec8ac11b020418f88547b1e4d810343e63a | [
"Apache-2.0"
] | 5 | 2019-10-24T20:06:16.000Z | 2020-10-16T06:17:46.000Z | utils/dataset_collection/airsim/airsim_fly.py | surirohit/multi-camera-deeptam | 37288ec8ac11b020418f88547b1e4d810343e63a | [
"Apache-2.0"
] | null | null | null | utils/dataset_collection/airsim/airsim_fly.py | surirohit/multi-camera-deeptam | 37288ec8ac11b020418f88547b1e4d810343e63a | [
"Apache-2.0"
] | 2 | 2020-01-06T03:20:05.000Z | 2021-02-10T09:44:29.000Z | ## Contributor: Mayank Mittal
# Script to fly the spawned drone in lawn mower patter
'''
~ # #########
^ # # #
| # # #
| # # #
Y # # #
| # # #
| # # #
v # # #
~ ######### #
<-X_step->
'''
import airsim
import sys
import ... | 31.571429 | 116 | 0.597568 |
ece5fe39963336d8da39dc6aa036ff4945895d13 | 2,415 | py | Python | vmprof_viewer_client/decorator.py | blue-yonder/vmprof-viewer-client | 6b7219e04a1e224bcb46f486b1acc58817af3b33 | [
"MIT"
] | 4 | 2018-09-06T23:36:56.000Z | 2020-01-06T12:07:03.000Z | vmprof_viewer_client/decorator.py | blue-yonder/vmprof-viewer-client | 6b7219e04a1e224bcb46f486b1acc58817af3b33 | [
"MIT"
] | null | null | null | vmprof_viewer_client/decorator.py | blue-yonder/vmprof-viewer-client | 6b7219e04a1e224bcb46f486b1acc58817af3b33 | [
"MIT"
] | 1 | 2020-11-06T09:31:52.000Z | 2020-11-06T09:31:52.000Z | import functools
import tempfile
import threading
import datetime
import pytz
import vmprof
from .protocol import upload
from .config import make_config
_global_config = None
_upload_threads = []
def configure(project_name, url=None, period=None):
global _global_config
_global_config = make_config(project... | 31.776316 | 95 | 0.580124 |
e3fbb55c1ffb95c9300129dae0c1943d67605144 | 9,219 | py | Python | sphinxcontrib/confluencebuilder/translator/__init__.py | zeddee/confluencebuilder | c32b2338b17ec949f3e9c68e9a3b1fa3148e5cb3 | [
"BSD-2-Clause"
] | null | null | null | sphinxcontrib/confluencebuilder/translator/__init__.py | zeddee/confluencebuilder | c32b2338b17ec949f3e9c68e9a3b1fa3148e5cb3 | [
"BSD-2-Clause"
] | 2 | 2020-08-08T22:03:17.000Z | 2020-12-19T00:42:22.000Z | sphinxcontrib/confluencebuilder/translator/__init__.py | zeddee/confluencebuilder | c32b2338b17ec949f3e9c68e9a3b1fa3148e5cb3 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
:copyright: Copyright 2016-2020 Sphinx Confluence Builder Contributors (AUTHORS)
:license: BSD-2-Clause (LICENSE)
"""
from docutils import nodes
from docutils.nodes import NodeVisitor as BaseTranslator
from os import path
from sphinx.util.osutil import SEP
from sphinx.util.osutil import can... | 32.925 | 80 | 0.57555 |
28bed5efbf1ce8e0bda54789510bb25e2e480d41 | 271 | py | Python | openmoc/cuda/double/__init__.py | samuelshaner/OpenMOC-shaner | 52a9003eef0de0629aae4aa4030b5e8d2c3f9988 | [
"MIT"
] | null | null | null | openmoc/cuda/double/__init__.py | samuelshaner/OpenMOC-shaner | 52a9003eef0de0629aae4aa4030b5e8d2c3f9988 | [
"MIT"
] | null | null | null | openmoc/cuda/double/__init__.py | samuelshaner/OpenMOC-shaner | 52a9003eef0de0629aae4aa4030b5e8d2c3f9988 | [
"MIT"
] | null | null | null | import openmoc
import _openmoc_cuda_double
from openmoc_cuda_double import *
import signal
# Tell Python to recognize CTRL+C and stop the C++ extension module
# when this is passed in from the keyboard
signal.signal(signal.SIGINT, signal.SIG_DFL)
Timer = openmoc.Timer
| 24.636364 | 67 | 0.808118 |
20b2e3e32b7c66d0208f3258b3c38daa89dc0d38 | 297 | py | Python | test/sysinfo_test.py | peitur/docker-util | 6579c59b809a3dab80c440baa5fabc669cf88b9b | [
"Apache-2.0"
] | 1 | 2016-05-19T13:43:21.000Z | 2016-05-19T13:43:21.000Z | test/sysinfo_test.py | peitur/docker-util | 6579c59b809a3dab80c440baa5fabc669cf88b9b | [
"Apache-2.0"
] | 1 | 2020-11-23T10:21:16.000Z | 2020-11-23T10:25:16.000Z | test/sysinfo_test.py | peitur/docker-util | 6579c59b809a3dab80c440baa5fabc669cf88b9b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import sys,os,re
sys.path.append( "../lib" )
sys.path.append( "./lib" )
import Controller
import unittest
from pprint import pprint
class SysinfoTest( unittest.TestCase ):
def test_configuration( self ):
pass
def test_information( self ):
pass
| 13.5 | 39 | 0.666667 |
a1d9a084fd04e5bb827c7a46e4343f7636cc106c | 2,178 | py | Python | junit/__init__.py | airadier/publish-unit-test-result-action | e44dbcba11ebe8c0a1e4e7b3e24ba7945bb79c35 | [
"Apache-2.0"
] | null | null | null | junit/__init__.py | airadier/publish-unit-test-result-action | e44dbcba11ebe8c0a1e4e7b3e24ba7945bb79c35 | [
"Apache-2.0"
] | null | null | null | junit/__init__.py | airadier/publish-unit-test-result-action | e44dbcba11ebe8c0a1e4e7b3e24ba7945bb79c35 | [
"Apache-2.0"
] | null | null | null | from html import unescape
from typing import Optional, Iterable
from junitparser import *
from unittestresults import ParsedUnitTestResults, UnitTestCase
def parse_junit_xml_files(files: Iterable[str]) -> ParsedUnitTestResults:
"""Parses junit xml files and returns aggregated statistics as a ParsedUnitTestResul... | 38.210526 | 117 | 0.665289 |
68d914668ada25beab7cafdb467f0298a1393e34 | 897 | py | Python | app/products/views/vendor_views/express.py | phessabi/eshop | 6a5352753a0c27f9c3f0eda6eec696f49ef4a8eb | [
"Apache-2.0"
] | 1 | 2020-02-04T21:18:31.000Z | 2020-02-04T21:18:31.000Z | app/products/views/vendor_views/express.py | phessabi/eshop | 6a5352753a0c27f9c3f0eda6eec696f49ef4a8eb | [
"Apache-2.0"
] | 12 | 2020-01-01T11:46:33.000Z | 2022-03-12T00:10:01.000Z | app/products/views/vendor_views/express.py | phessabi/eshop | 6a5352753a0c27f9c3f0eda6eec696f49ef4a8eb | [
"Apache-2.0"
] | 1 | 2020-02-18T11:12:48.000Z | 2020-02-18T11:12:48.000Z | from rest_framework import status
from rest_framework.generics import UpdateAPIView
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.viewsets import GenericViewSet
from _helpers.permissions import IsVendor
from products.models import Product
from p... | 35.88 | 68 | 0.770346 |
2171283a13a12ad82e0befd3a0c64e3c6056b45a | 1,294 | py | Python | Clustering/K Means/k_means_clustering.py | vnc-edu/machine-learning | 5a212ae303c5db319c0474077a13eb663aff2c54 | [
"Apache-2.0"
] | null | null | null | Clustering/K Means/k_means_clustering.py | vnc-edu/machine-learning | 5a212ae303c5db319c0474077a13eb663aff2c54 | [
"Apache-2.0"
] | null | null | null | Clustering/K Means/k_means_clustering.py | vnc-edu/machine-learning | 5a212ae303c5db319c0474077a13eb663aff2c54 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
dataset = pd.read_csv('Mall_Customers.csv')
X = dataset.iloc[:, [3, 4]].values
wcss = []
for k in range(1, 11):
kmeans = KMeans(n_clusters=k, init='k-means++', random_state=42)
kmeans.fit(X)
wcss.appe... | 34.972973 | 110 | 0.667697 |
a4c391296015ad6cc9fcc117f47401e808936b90 | 515 | py | Python | dauphin/image/transforms/sharpness.py | PushparajaMurugan/dauphin | 4d9832c72288282e6b3d03be1b0ad8708282b005 | [
"Apache-2.0"
] | 18 | 2020-07-08T21:53:09.000Z | 2021-02-18T03:46:54.000Z | dauphin/image/transforms/sharpness.py | PushparajaMurugan/dauphin | 4d9832c72288282e6b3d03be1b0ad8708282b005 | [
"Apache-2.0"
] | 4 | 2020-08-30T17:47:35.000Z | 2020-12-04T12:09:41.000Z | dauphin/image/transforms/sharpness.py | PushparajaMurugan/dauphin | 4d9832c72288282e6b3d03be1b0ad8708282b005 | [
"Apache-2.0"
] | 8 | 2020-07-12T08:03:30.000Z | 2021-04-13T15:09:37.000Z | from PIL import ImageEnhance
from dauphin.image.transforms.transform import DauphinTransform
from dauphin.image.transforms.utils import categorize_value
class Sharpness(DauphinTransform):
value_range = (0.1, 1.9)
def __init__(self, name=None, prob=1.0, level=0):
super().__init__(name, prob, level)
... | 30.294118 | 72 | 0.733981 |
fb9fe3996c993f0ac6361e504400cb78419b7eb7 | 2,856 | py | Python | docker_registry/run.py | kirat-singh/docker-registry | ca53d728fb57302606892362820dfaa8aed105c5 | [
"Apache-2.0"
] | 1,568 | 2015-01-01T02:12:42.000Z | 2020-03-10T06:24:39.000Z | docker_registry/run.py | kirat-singh/docker-registry | ca53d728fb57302606892362820dfaa8aed105c5 | [
"Apache-2.0"
] | 316 | 2015-01-01T01:15:21.000Z | 2018-09-10T21:19:04.000Z | docker_registry/run.py | kirat-singh/docker-registry | ca53d728fb57302606892362820dfaa8aed105c5 | [
"Apache-2.0"
] | 596 | 2015-01-03T03:54:42.000Z | 2020-03-05T14:40:55.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse # noqa
import distutils.spawn
import getpass
import logging
import os
import sys
from .server import env
logger = logging.getLogger(__name__)
DESCRIPTION = """run the docker-registry with gunicorn, honoring the following
environment v... | 31.384615 | 78 | 0.668417 |
64cfd6b7b481025dd362715f1b4a2afc35091bd3 | 2,687 | py | Python | ingest/ingest_echr.py | alexbas/index_thio | d9d75cee93522800fe8ef988247a240c78668a5c | [
"MIT"
] | 1 | 2021-04-17T20:01:20.000Z | 2021-04-17T20:01:20.000Z | ingest/ingest_echr.py | alexbas/index_thio | d9d75cee93522800fe8ef988247a240c78668a5c | [
"MIT"
] | null | null | null | ingest/ingest_echr.py | alexbas/index_thio | d9d75cee93522800fe8ef988247a240c78668a5c | [
"MIT"
] | null | null | null | from os import path
import hashlib
import json
import argparse
from urllib.request import urlretrieve
from zipfile import ZipFile
from tqdm import tqdm
from confluent_kafka import Producer
DATASET_ADDRESS = 'https://archive.org/download/ECHR-ACL2019/ECHR_Dataset.zip'
def should_download(fn):
# if file does not... | 23.778761 | 88 | 0.582434 |
af0296ba2f611fa1d8ed82f6eb82167be81a28ca | 1,500 | py | Python | kata-python/zigzagconversion.py | crimsonskyrem/codewars | ca2ef839af068d6aecd5c321cb3848ae5f8bfea4 | [
"Unlicense"
] | 1 | 2022-01-10T05:43:41.000Z | 2022-01-10T05:43:41.000Z | kata-python/zigzagconversion.py | crimsonskyrem/codewars | ca2ef839af068d6aecd5c321cb3848ae5f8bfea4 | [
"Unlicense"
] | null | null | null | kata-python/zigzagconversion.py | crimsonskyrem/codewars | ca2ef839af068d6aecd5c321cb3848ae5f8bfea4 | [
"Unlicense"
] | null | null | null | def convert(s: str, numRows: int) -> str:
if numRows == 1:
return s
if numRows == 2:
return s[::2] + s[1::2]
arr = []
row = 0
column = 0
pos = numRows - 2
sl = list(s)
q = column % (numRows -1)
while sl:
if q == 0:
if row >= len(arr):
... | 25 | 44 | 0.396 |
e756ca33740f7e77b79ec23db87016333edca065 | 34,133 | py | Python | synthetic_data/STLGenerateSignal_plotpaper.py | KTH-RPL-Planiacs/stl_multiclass | c4d7de8882780337382d266096d69cd2eb89d14e | [
"MIT"
] | null | null | null | synthetic_data/STLGenerateSignal_plotpaper.py | KTH-RPL-Planiacs/stl_multiclass | c4d7de8882780337382d266096d69cd2eb89d14e | [
"MIT"
] | null | null | null | synthetic_data/STLGenerateSignal_plotpaper.py | KTH-RPL-Planiacs/stl_multiclass | c4d7de8882780337382d266096d69cd2eb89d14e | [
"MIT"
] | null | null | null | from STL import STLFormula
import operator as operatorclass
import pulp as plp
import matplotlib.pyplot as plt
plt.rcParams['font.size'] = '12'
# plt.rcParams['mathtext.fontset'] = 'custom'
# plt.rcParams['mathtext.rm'] = 'Bitstream Vera Sans'
# plt.rcParams['mathtext.it'] = 'Bitstream Vera Sans:italic'
# plt.rcParams[... | 48.831187 | 257 | 0.599889 |
aef45d31653564aa7938773007cc5e2370e40c7f | 1,095 | py | Python | simpleMoveExample/moveGlyphWinow.py | typemytype/RoboFontExamples | cc5668de3d27ce996cff5eadb32d0b905c2aff65 | [
"MIT"
] | 12 | 2015-01-03T12:34:18.000Z | 2022-01-24T13:11:35.000Z | simpleMoveExample/moveGlyphWinow.py | typemytype/RoboFontExamples | cc5668de3d27ce996cff5eadb32d0b905c2aff65 | [
"MIT"
] | null | null | null | simpleMoveExample/moveGlyphWinow.py | typemytype/RoboFontExamples | cc5668de3d27ce996cff5eadb32d0b905c2aff65 | [
"MIT"
] | 3 | 2015-01-02T13:38:09.000Z | 2016-05-06T21:36:01.000Z | from vanilla import *
class MoveGlyphWindow:
def __init__(self, glyph):
if glyph is None:
print "There should be a glyph window selected!!"
return
self.glyph = glyph
self.moveX = 0
self.moveY = 0
self.w = Window((200, 60), "Move %s" %self.glyph.name... | 28.076923 | 62 | 0.447489 |
82a8045fc9226dd4c97954c5243f820b65670d08 | 669 | py | Python | frequently/tests/urls.py | bitlabstudio/django-frequently | 93c76af62325afd1f09487dd1bb527fdd238ec8e | [
"MIT"
] | 5 | 2016-12-08T21:40:54.000Z | 2020-04-08T07:05:22.000Z | frequently/tests/urls.py | bitlabstudio/django-frequently | 93c76af62325afd1f09487dd1bb527fdd238ec8e | [
"MIT"
] | null | null | null | frequently/tests/urls.py | bitlabstudio/django-frequently | 93c76af62325afd1f09487dd1bb527fdd238ec8e | [
"MIT"
] | 1 | 2019-11-29T13:35:05.000Z | 2019-11-29T13:35:05.000Z | """
This ``urls.py`` is only used when running the tests via ``runtests.py``.
As you know, every app must be hooked into yout main ``urls.py`` so that
you can actually reach the app's views (provided it has any views, of course).
"""
from django.urls import include, path
from django.contrib import admin
from django.co... | 29.086957 | 78 | 0.735426 |
0efb0d3957d60399c035f4577df48d0e8efb7ca4 | 92,357 | py | Python | superset/viz.py | ITV/incubator-superset | 5814bdf699f1ff3da0e6f24ee803a611c5059752 | [
"Apache-2.0"
] | 1 | 2020-11-07T14:08:16.000Z | 2020-11-07T14:08:16.000Z | superset/viz.py | ITV/incubator-superset | 5814bdf699f1ff3da0e6f24ee803a611c5059752 | [
"Apache-2.0"
] | 7 | 2020-03-24T18:00:40.000Z | 2022-03-29T22:28:01.000Z | superset/viz.py | ITV/incubator-superset | 5814bdf699f1ff3da0e6f24ee803a611c5059752 | [
"Apache-2.0"
] | 1 | 2020-02-11T14:42:57.000Z | 2020-02-11T14:42:57.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.126614 | 88 | 0.552367 |
d4547d513cdf3e4bc0352d9652d44729dd151c85 | 2,817 | py | Python | dataset/loader.py | yilmazbaysal/CBDNet-pytorch | 6e4aa5021710177a2f7400e4dc9ffa780ccfc802 | [
"MIT"
] | 120 | 2019-05-29T03:55:56.000Z | 2022-03-21T04:55:12.000Z | dataset/loader.py | yilmazbaysal/CBDNet-pytorch | 6e4aa5021710177a2f7400e4dc9ffa780ccfc802 | [
"MIT"
] | 27 | 2019-06-03T07:03:31.000Z | 2021-12-17T07:19:28.000Z | dataset/loader.py | yilmazbaysal/CBDNet-pytorch | 6e4aa5021710177a2f7400e4dc9ffa780ccfc802 | [
"MIT"
] | 25 | 2019-06-17T10:52:35.000Z | 2022-03-07T06:52:10.000Z | import os
import random
import torch
import numpy as np
import glob
from torch.utils.data import Dataset
from utils import read_img, hwc_to_chw
def get_patch(imgs, patch_size):
H = imgs[0].shape[0]
W = imgs[0].shape[1]
ps_temp = min(H, W, patch_size)
xx = np.random.randint(0, W-ps_temp) if W > ps_temp else 0
... | 27.617647 | 151 | 0.695421 |
246a55f45e853815176effffcf34ec510ab7cd54 | 9,767 | py | Python | Lib/site-packages/pyqode/core/backend/workers.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | Lib/site-packages/pyqode/core/backend/workers.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/pyqode/core/backend/workers.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 1 | 2021-12-15T20:07:45.000Z | 2021-12-15T20:07:45.000Z | # -*- coding: utf-8 -*-
"""
This module contains the worker functions/classes used on the server side.
A worker is a function or a callable which receive one single argument (the
decoded json object) and returns a tuple made up of a status (bool) and a
response object (json serializable).
A worker is always tightly c... | 32.996622 | 79 | 0.57981 |
e80aa1572085cf7e13a3007de5b046390d085107 | 7,830 | py | Python | test/unit/test_objectstore.py | mysticmirages/GalaxyProject | 6a47d2d3a7f27b659e5de5fb1b37c7c1f9d04302 | [
"CC-BY-3.0"
] | null | null | null | test/unit/test_objectstore.py | mysticmirages/GalaxyProject | 6a47d2d3a7f27b659e5de5fb1b37c7c1f9d04302 | [
"CC-BY-3.0"
] | null | null | null | test/unit/test_objectstore.py | mysticmirages/GalaxyProject | 6a47d2d3a7f27b659e5de5fb1b37c7c1f9d04302 | [
"CC-BY-3.0"
] | null | null | null | import os
from shutil import rmtree
from string import Template
from tempfile import mkdtemp
try:
from galaxy import objectstore
except ImportError:
from lwr import objectstore
from contextlib import contextmanager
DISK_TEST_CONFIG = """<?xml version="1.0"?>
<object_store type="disk">
<files_dir path="${te... | 37.109005 | 103 | 0.673691 |
9110bd72dd2200f5dde0bea3efc183b2f23a004a | 669 | py | Python | FOREX/USECASE2/producer.py | kareemv46/Project3 | eeb63d69d69c7a3ff909a284e27740beb083ff10 | [
"MIT"
] | 1 | 2021-12-14T14:41:02.000Z | 2021-12-14T14:41:02.000Z | FOREX/USECASE2/producer.py | 6618karan/Stock-Analysis | 6a4008acc8f48abc5dc4f33cbe9f329451343459 | [
"MIT"
] | null | null | null | FOREX/USECASE2/producer.py | 6618karan/Stock-Analysis | 6a4008acc8f48abc5dc4f33cbe9f329451343459 | [
"MIT"
] | 3 | 2021-09-28T09:50:49.000Z | 2021-10-01T11:35:41.000Z | #This file is going to be used for producer
#first create a topic name as 'project3'
from kafka import KafkaProducer
import requests
from json import dumps
import time
kafka_data_producers = KafkaProducer(bootstrap_servers=['localhost:9092'],value_serializer=lambda x: dumps(x).encode('utf-8') )
while True:
respo... | 33.45 | 141 | 0.745889 |
091bad48d29d767c2c09ae65d8c6ffd6c0d44cd9 | 4,564 | py | Python | charcoal/utils.py | ctb/2020-charcoal-metagenome-abundance-foo | dc99f7774c20c942a2966186496351d7e575e34a | [
"BSD-3-Clause"
] | null | null | null | charcoal/utils.py | ctb/2020-charcoal-metagenome-abundance-foo | dc99f7774c20c942a2966186496351d7e575e34a | [
"BSD-3-Clause"
] | null | null | null | charcoal/utils.py | ctb/2020-charcoal-metagenome-abundance-foo | dc99f7774c20c942a2966186496351d7e575e34a | [
"BSD-3-Clause"
] | null | null | null | """
utility functions for charcoal.
"""
import math
import numpy as np
from numpy import genfromtxt
import screed
from sourmash.lca import lca_utils
def load_hashset(filename):
"Load set of hashes from a file."
with open(filename, 'rt') as fp:
hashes = set([ int(x.strip()) for x in fp if x.strip() ])... | 26.229885 | 80 | 0.611744 |
61800c21aa465a9bba1c4b8488ceedc20d8316fd | 3,818 | py | Python | tests/test_es_utils.py | LandRegistry/digital-register-elasticsearch-updater | 2e7b95d8d5eac70e9bba6612bed09bf58376e781 | [
"MIT"
] | null | null | null | tests/test_es_utils.py | LandRegistry/digital-register-elasticsearch-updater | 2e7b95d8d5eac70e9bba6612bed09bf58376e781 | [
"MIT"
] | 12 | 2015-06-05T15:10:25.000Z | 2016-04-21T15:17:19.000Z | tests/test_es_utils.py | LandRegistry/digital-register-elasticsearch-updater | 2e7b95d8d5eac70e9bba6612bed09bf58376e781 | [
"MIT"
] | 1 | 2021-04-11T06:03:41.000Z | 2021-04-11T06:03:41.000Z | import mock
from service import es_utils
# TODO: partly to be replaced by proper integration tests
class TestEsUtils:
@mock.patch(
'service.es_utils.elasticsearch_client.indices.status',
return_value={'indices': []}
)
@mock.patch('service.es_utils.elasticsearch_client.index')
@mock.p... | 36.018868 | 97 | 0.662651 |
5fdeb55763d07fb63c6a6d253f3a58d84bff195f | 35,999 | py | Python | cvxpy/tests/test_conic_solvers.py | tuelwer/cvxpy | daa2a92eef97c4e8870c280afce71273fc64ea11 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/tests/test_conic_solvers.py | tuelwer/cvxpy | daa2a92eef97c4e8870c280afce71273fc64ea11 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/tests/test_conic_solvers.py | tuelwer/cvxpy | daa2a92eef97c4e8870c280afce71273fc64ea11 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
Copyright 2019, the CVXPY developers.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | 35.466995 | 95 | 0.598267 |
06fec392ffe6ed6240b2e3e8b401a61ab7d28ff8 | 1,586 | py | Python | apps/tweets/tests/test_web_api.py | thinkAmi/dj_ringo_tabetter | 9169f8e26cf4a85ed4efb7fcda1f0dd763a8cebb | [
"MIT"
] | null | null | null | apps/tweets/tests/test_web_api.py | thinkAmi/dj_ringo_tabetter | 9169f8e26cf4a85ed4efb7fcda1f0dd763a8cebb | [
"MIT"
] | 9 | 2020-02-11T21:44:18.000Z | 2022-02-10T09:19:42.000Z | apps/tweets/tests/test_web_api.py | thinkAmi/dj_ringo_tabetter | 9169f8e26cf4a85ed4efb7fcda1f0dd763a8cebb | [
"MIT"
] | null | null | null | import os
from typing import List
from unittest.mock import Mock
import pytest
def _is_lack_of_environment_variables(environment_variable_names: List[str]) -> bool:
""" 環境変数が不足しているかをチェック
:param environment_variable_names: 対象の環境名変数リスト
:return: 不足している場合、True
"""
for name in environment_variable_na... | 29.37037 | 109 | 0.679697 |
211dd4e2b4b0371b0b39cf075805c01ea9c9ad75 | 2,407 | py | Python | project/apps/registration/fields.py | dbinetti/barberscore | 13c3d8193834bd2bb79922e28d3f5ab1675bdffd | [
"BSD-2-Clause"
] | 13 | 2017-08-07T15:45:49.000Z | 2019-07-03T13:58:50.000Z | project/apps/registration/fields.py | barberscore/barberscore-api | 2aa9f8598c18c28ba1d4a294f76fd055619f803e | [
"BSD-2-Clause"
] | 309 | 2017-07-14T02:34:12.000Z | 2022-01-14T21:37:02.000Z | project/apps/registration/fields.py | dbinetti/barberscore-django | 16fbd9945becda0a765bbdf52ad459a63655128f | [
"BSD-2-Clause"
] | 5 | 2017-08-07T14:01:07.000Z | 2019-06-24T19:44:55.000Z |
# Standard Library
import os
# Third-Party
import pytz
import six
from rest_framework_json_api import serializers
# Django
from django.core.exceptions import ValidationError
from django.db.models import EmailField
from django.utils.deconstruct import deconstructible
from django.contrib.postgres.fields import ArrayF... | 27.666667 | 75 | 0.651849 |
a5bce036ba17bd4b3d238a73cd3f7dd39d32df4a | 5,577 | py | Python | ursina/build.py | cezidev/ursina | d51c666eae42e64b03ec6c71871e5197c9ebbbab | [
"MIT"
] | 1 | 2020-09-04T14:32:33.000Z | 2020-09-04T14:32:33.000Z | ursina/build.py | Noah-shn/ursina | d51c666eae42e64b03ec6c71871e5197c9ebbbab | [
"MIT"
] | null | null | null | ursina/build.py | Noah-shn/ursina | d51c666eae42e64b03ec6c71871e5197c9ebbbab | [
"MIT"
] | 1 | 2020-09-04T14:32:41.000Z | 2020-09-04T14:32:41.000Z | from modulefinder import ModuleFinder
import os
import sys
import shutil
from shutil import copy, copyfile
from distutils.dir_util import copy_tree
from pathlib import Path
import time
def copytree(src, dst, symlinks=False, ignore=None):
src = str(src)
dst = str(dst)
for item in os.listdir(src):
... | 31.868571 | 107 | 0.65806 |
007f9396a3f83735759d37ebd51dce309272b13a | 61 | py | Python | models/__init__.py | juanmc2005/MetricAMI | 8cb9fbe8dcf5303f1b44007f03492e065e867caf | [
"MIT"
] | 5 | 2020-05-25T09:27:08.000Z | 2021-10-01T09:11:46.000Z | models/__init__.py | juanmc2005/MetricAMI | 8cb9fbe8dcf5303f1b44007f03492e065e867caf | [
"MIT"
] | null | null | null | models/__init__.py | juanmc2005/MetricAMI | 8cb9fbe8dcf5303f1b44007f03492e065e867caf | [
"MIT"
] | 1 | 2021-10-15T04:00:25.000Z | 2021-10-15T04:00:25.000Z | from .base import MetricNet
from .ami import AMILSTM, AMIBert | 30.5 | 33 | 0.819672 |
030ce6cbdf6bd27aec7236db8da2db885f1d63c3 | 1,001 | py | Python | src/doc/help2man_preformat.py | rmv/oiio | f9b45b96ec032fc94023f67433ca9bb97ba1ec5d | [
"BSD-3-Clause-Clear",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/doc/help2man_preformat.py | rmv/oiio | f9b45b96ec032fc94023f67433ca9bb97ba1ec5d | [
"BSD-3-Clause-Clear",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/doc/help2man_preformat.py | rmv/oiio | f9b45b96ec032fc94023f67433ca9bb97ba1ec5d | [
"BSD-3-Clause-Clear",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# Format the output from various oiio command line "$tool --help" invocations,
# and munge such that txt2man generates a simple man page with not-too-horrible
# formatting.
from __future__ import print_function
from __future__ import absolute_import
import sys
lines = [l.rstrip().replace('\t', ' '*... | 25.025 | 80 | 0.685315 |
8bd1767154cf34be5d653c7bb2323b720bccb790 | 19,603 | py | Python | grit/tool/build.py | lhopps/grit-i18n | 4e6ce0db3bd8d674851a74a7415be17ae95247e2 | [
"BSD-2-Clause"
] | null | null | null | grit/tool/build.py | lhopps/grit-i18n | 4e6ce0db3bd8d674851a74a7415be17ae95247e2 | [
"BSD-2-Clause"
] | null | null | null | grit/tool/build.py | lhopps/grit-i18n | 4e6ce0db3bd8d674851a74a7415be17ae95247e2 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''The 'grit build' tool along with integration for this tool with the
SCons build system.
'''
import filecmp
import getopt
import... | 39.284569 | 83 | 0.656328 |
b910140ff812bb62978f041cffbbb1f878a4c815 | 86 | py | Python | notion_export_enhancer/__main__.py | Cobertos/notion-export-enhancer | 07a34d4b3daeb1ec69cd4253c089ba4d9dc5bbc3 | [
"MIT"
] | 17 | 2021-01-28T11:03:47.000Z | 2022-02-10T22:51:44.000Z | notion_export_enhancer/__main__.py | wongsingfo/notion_export_enhancer | bb036640e95b37ba74c9184a0448f19e644dc90c | [
"MIT"
] | 3 | 2021-03-21T02:35:24.000Z | 2021-10-05T07:10:22.000Z | notion_export_enhancer/__main__.py | wongsingfo/notion_export_enhancer | bb036640e95b37ba74c9184a0448f19e644dc90c | [
"MIT"
] | 4 | 2021-03-21T03:39:36.000Z | 2022-01-19T07:05:14.000Z | import sys
from .enhancer import cli
if __name__ == "__main__":
cli(sys.argv[1:]) | 17.2 | 26 | 0.686047 |
fc45e6f3d8acb520eafaaa2fb3fbce6c424370c7 | 5,995 | py | Python | Machine_Learning/Feature_Tutorials/01-freezing_a_keras_model/files/train_save.py | mkolod/Vitis-Tutorials | 33d6cf9686398ef1179778dc0da163291c68b465 | [
"Apache-2.0"
] | 1 | 2022-03-15T22:07:18.000Z | 2022-03-15T22:07:18.000Z | Machine_Learning/Feature_Tutorials/01-freezing_a_keras_model/files/train_save.py | mkolod/Vitis-Tutorials | 33d6cf9686398ef1179778dc0da163291c68b465 | [
"Apache-2.0"
] | null | null | null | Machine_Learning/Feature_Tutorials/01-freezing_a_keras_model/files/train_save.py | mkolod/Vitis-Tutorials | 33d6cf9686398ef1179778dc0da163291c68b465 | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2020 Xilinx Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | 28.961353 | 76 | 0.585988 |
697e256ad1634e00ee451ec75b455c7a76204e0f | 3,146 | py | Python | challengenews/tests/test_serializers.py | scpaes/jungledevs-challenge | 188bc7a4aacbb278a9486c57685db53be0477d51 | [
"MIT"
] | null | null | null | challengenews/tests/test_serializers.py | scpaes/jungledevs-challenge | 188bc7a4aacbb278a9486c57685db53be0477d51 | [
"MIT"
] | 6 | 2021-08-10T02:19:35.000Z | 2021-08-10T02:24:05.000Z | challengenews/tests/test_serializers.py | scpaes/jungledevs-challenge | 188bc7a4aacbb278a9486c57685db53be0477d51 | [
"MIT"
] | null | null | null | from django.test import TestCase
from rest_framework import serializers
from django.contrib.auth.models import User
from challengenews.serializers import *
from challengenews.models import *
class UserSerializerTestCase(TestCase):
"""
Teste unitário.
Classe para teste do serializer da model user... | 28.342342 | 97 | 0.602352 |
53c2930a2fd5f0c62418bf6ca75818a0a43809b8 | 650 | py | Python | listings/listings/posts/migrations/0003_auto_20201111_1505.py | AAM77/listings_backend | 7ed0950e54e12b737b46b56b82653c2842fdf6cf | [
"MIT"
] | null | null | null | listings/listings/posts/migrations/0003_auto_20201111_1505.py | AAM77/listings_backend | 7ed0950e54e12b737b46b56b82653c2842fdf6cf | [
"MIT"
] | null | null | null | listings/listings/posts/migrations/0003_auto_20201111_1505.py | AAM77/listings_backend | 7ed0950e54e12b737b46b56b82653c2842fdf6cf | [
"MIT"
] | null | null | null | # Generated by Django 3.0.11 on 2020-11-11 20:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0002_auto_20201110_1619'),
]
operations = [
migrations.AlterField(
model_name='language',
name='listing',
... | 27.083333 | 107 | 0.603077 |
b750d6db0a082a62112ec172013e9c7e24a7b4bb | 2,996 | py | Python | examples/od8_const_vel_two_agent.py | grzPat/bark | 807092815c81eeb23defff473449a535a9c42f8b | [
"MIT"
] | null | null | null | examples/od8_const_vel_two_agent.py | grzPat/bark | 807092815c81eeb23defff473449a535a9c42f8b | [
"MIT"
] | null | null | null | examples/od8_const_vel_two_agent.py | grzPat/bark | 807092815c81eeb23defff473449a535a9c42f8b | [
"MIT"
] | null | null | null | # Copyright (c) 2019 fortiss GmbH
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import numpy as np
import time
import os
from bark.world.agent import *
from bark.models.behavior import *
from bark.world import *
from bark.world.map import *
from bark.models.dynamic import *... | 32.923077 | 85 | 0.685915 |
be3c337dd605cb0ea8b605c922fc5c1286356939 | 551 | py | Python | mail/index.py | VanOvermeire/twittersearch | 7326a1e623c4bb5cb0931805fd1e24544b17ade3 | [
"MIT"
] | null | null | null | mail/index.py | VanOvermeire/twittersearch | 7326a1e623c4bb5cb0931805fd1e24544b17ade3 | [
"MIT"
] | null | null | null | mail/index.py | VanOvermeire/twittersearch | 7326a1e623c4bb5cb0931805fd1e24544b17ade3 | [
"MIT"
] | null | null | null | import boto3
from twittersearchhelpers import twitter_ses, twitter_s3
# doing this outside the lambda is better for performance
s3_client = boto3.client('s3')
ses_client = boto3.client('ses')
def my_handler(event, context):
bucket, key = twitter_s3.extract_bucket_and_key_from_event(event)
url = twitter_s3.ge... | 29 | 69 | 0.749546 |
142d4367fd8537a0a8830b288066404606fcf74c | 148 | py | Python | customcalendar/models/__init__.py | IgalMilman/DnDHelper | 334822a489e7dc2b5ae17230e5c068b89c6c5d10 | [
"MIT"
] | null | null | null | customcalendar/models/__init__.py | IgalMilman/DnDHelper | 334822a489e7dc2b5ae17230e5c068b89c6c5d10 | [
"MIT"
] | null | null | null | customcalendar/models/__init__.py | IgalMilman/DnDHelper | 334822a489e7dc2b5ae17230e5c068b89c6c5d10 | [
"MIT"
] | null | null | null | from customcalendar.models import calendarsettings
from customcalendar.models import calendarevent
from customcalendar.models import permissionevent | 49.333333 | 50 | 0.905405 |
5a5fe2adedf7c38ec307479484b3e1f4391b153d | 4,612 | py | Python | mnemonics-training/2_eval/models/resnet_cifar.py | mhd-medfa/class-incremental-learning | c7c0a217d07b285f215672b3021beee52d4ef74f | [
"MIT"
] | 241 | 2020-10-12T08:53:17.000Z | 2022-03-30T02:39:38.000Z | mnemonics-training/2_eval/models/resnet_cifar.py | mhd-medfa/class-incremental-learning | c7c0a217d07b285f215672b3021beee52d4ef74f | [
"MIT"
] | 29 | 2020-12-21T02:46:57.000Z | 2022-03-24T07:51:58.000Z | mnemonics-training/2_eval/models/resnet_cifar.py | mhd-medfa/class-incremental-learning | c7c0a217d07b285f215672b3021beee52d4ef74f | [
"MIT"
] | 40 | 2020-10-14T07:54:31.000Z | 2022-03-29T16:54:38.000Z | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
from utils.incremental.conv2d_mtl import Conv2d
def conv3x3(in_planes, out_planes, stride=1):
"""3x3 convolution with padding"""
return Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=Fa... | 30.543046 | 90 | 0.584562 |
6a7044dec305dfb0134040000c653d423aba6585 | 33,610 | py | Python | mtgjson4/compile_mtg.py | rohitmusti/mtgjson | ed2273dc1de736267aac7f81e26af857acad24be | [
"MIT"
] | null | null | null | mtgjson4/compile_mtg.py | rohitmusti/mtgjson | ed2273dc1de736267aac7f81e26af857acad24be | [
"MIT"
] | null | null | null | mtgjson4/compile_mtg.py | rohitmusti/mtgjson | ed2273dc1de736267aac7f81e26af857acad24be | [
"MIT"
] | null | null | null | """Compile incoming data into the target output format."""
import contextvars
import copy
import json
import logging
import multiprocessing
import os
import pathlib
import re
from typing import Any, Dict, List, Optional, Set, Tuple
from mkmsdk.api_map import _API_MAP
from mkmsdk.mkm import Mkm
import mtgjson4
from mt... | 37.469342 | 100 | 0.586343 |
661f8e7957ae18bd50aeaf8a1cd68777acafce6d | 1,361 | py | Python | rmfriend/pagedata.py | oisinmulvihill/remarkable-friend | 00650302e9815f546bd9525f5af4140ad6d518b6 | [
"MIT"
] | 2 | 2018-07-14T20:05:55.000Z | 2018-10-07T20:42:00.000Z | rmfriend/pagedata.py | oisinmulvihill/remarkable-friend | 00650302e9815f546bd9525f5af4140ad6d518b6 | [
"MIT"
] | 1 | 2018-08-08T13:41:45.000Z | 2018-08-13T02:14:58.000Z | rmfriend/pagedata.py | oisinmulvihill/remarkable-friend | 00650302e9815f546bd9525f5af4140ad6d518b6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
"""
class PageData(object):
"""This file contains a list of templates used on each page of a notebook.
On the reMarkable device a notebook will have a '<UUID>.pagedata' file.
The first page i.e. element 0 of the pages member represents the template
for page 0 in the Notebo... | 24.745455 | 78 | 0.584129 |
f5627a2450636cdce4bb0519095054bdf8993bdb | 11,671 | py | Python | src/lambda-function.py | jgreenemi/Parris | 94764011ba81eb74927a548f0c3aa01bfa4280a7 | [
"Apache-2.0"
] | 354 | 2018-01-01T13:17:24.000Z | 2021-12-15T06:00:42.000Z | src/lambda-function.py | jgreenemi/Parris | 94764011ba81eb74927a548f0c3aa01bfa4280a7 | [
"Apache-2.0"
] | 7 | 2018-01-02T02:25:27.000Z | 2018-01-02T03:36:53.000Z | src/lambda-function.py | jgreenemi/Parris | 94764011ba81eb74927a548f0c3aa01bfa4280a7 | [
"Apache-2.0"
] | 26 | 2018-01-01T18:32:05.000Z | 2019-09-01T06:45:26.000Z | # Create the CloudFormation stack with the trainer-script loaded.
import boto3
import json
import logging
import os
from pprint import pprint
def parse_training_config(training_config_path=''):
"""
Pull in a training config and return its contents.
:return:
"""
try:
# Default to the exist... | 38.774086 | 120 | 0.566532 |
b68951b55b5e5ecb4afe037fb94cb1df68998324 | 1,500 | py | Python | tally/api/tests.py | Mapkin/tally | 731940362c4c6003eed7f576620a89206fda312d | [
"MIT"
] | 1 | 2022-02-14T05:52:20.000Z | 2022-02-14T05:52:20.000Z | tally/api/tests.py | Mapkin/tally | 731940362c4c6003eed7f576620a89206fda312d | [
"MIT"
] | null | null | null | tally/api/tests.py | Mapkin/tally | 731940362c4c6003eed7f576620a89206fda312d | [
"MIT"
] | null | null | null | """
Unit tests for the API application.
"""
from django.contrib.auth.models import User
from django.test import TestCase
from tally.api.models import Client, Counter
import datetime
import time
class ClientTest(TestCase):
def test_create(self):
user = User.objects.create_user('test', 'test')
cl... | 29.411765 | 74 | 0.663333 |
3ad527eb840cdf962099f95c0c2685e4534db6eb | 11,564 | py | Python | utils.py | blockchainhelppro/Segwit-Development- | e4dfe990a69a2a1fcdd902b82121c2ecb1aa332d | [
"MIT"
] | null | null | null | utils.py | blockchainhelppro/Segwit-Development- | e4dfe990a69a2a1fcdd902b82121c2ecb1aa332d | [
"MIT"
] | null | null | null | utils.py | blockchainhelppro/Segwit-Development- | e4dfe990a69a2a1fcdd902b82121c2ecb1aa332d | [
"MIT"
] | null | null | null | """
Miscellaneous utility functions, wrappers around some subprocess procedures.
"""
import importlib
import inspect
import os
import shlex
import subprocess
import sys
import fcntl
from core import CoreCommandError
from core import logger
DEVNULL = open(os.devnull, "wb")
def _detach_init():
"""
Fork a ch... | 28.412776 | 112 | 0.642079 |
fbe0e1859dc705fd7758522e94a99aaf97f104cb | 6,740 | py | Python | library/skytap_environment.py | skytap/ansiblebase | d259c5e98a02d9bdb1202cd8792f40094a60d52b | [
"Apache-2.0"
] | null | null | null | library/skytap_environment.py | skytap/ansiblebase | d259c5e98a02d9bdb1202cd8792f40094a60d52b | [
"Apache-2.0"
] | null | null | null | library/skytap_environment.py | skytap/ansiblebase | d259c5e98a02d9bdb1202cd8792f40094a60d52b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2016 Ben Coleman
# Software provided under the terms of the Apache 2.0 license http://www.apache.org/licenses/LICENSE-2.0.txt
#
# 2019-01-23 - M.Measel - added Edit param to Modify action
# 2019-01-24 - M2 - added list_networks
# 2019-01-25 - M2 - added add_tag action
# 2... | 40.60241 | 168 | 0.695252 |
a8722436c8e2845dd408c6ce1090810f0732769e | 764 | py | Python | benchmarks/pymcell4/B5000_autophosphorylation/instantiation.py | mcellteam/mcell-tests | 34d2d967b75d56edbae999bf0090641850f4f4fe | [
"MIT"
] | 1 | 2021-08-13T20:40:54.000Z | 2021-08-13T20:40:54.000Z | benchmarks/pymcell4/B5000_autophosphorylation/instantiation.py | mcellteam/mcell_tests | 34d2d967b75d56edbae999bf0090641850f4f4fe | [
"MIT"
] | null | null | null | benchmarks/pymcell4/B5000_autophosphorylation/instantiation.py | mcellteam/mcell_tests | 34d2d967b75d56edbae999bf0090641850f4f4fe | [
"MIT"
] | null | null | null | # WARNING: This is an automatically generated file and will be overwritten
# by CellBlender on the next model export.
import os
import shared
import mcell as m
from parameters import *
from subsystem import *
MODEL_PATH = os.path.dirname(os.path.abspath(__file__))
# ---- instantiation ----
# ---- release ... | 25.466667 | 127 | 0.751309 |
d9f9b8448cfccea2ce1e7e85589539c6dda36276 | 9,488 | py | Python | tests/test_blockchain.py | s7p/bitcoingraph | 0d5edf9957db63c497bffb9d7bc0fb083c05bced | [
"MIT"
] | null | null | null | tests/test_blockchain.py | s7p/bitcoingraph | 0d5edf9957db63c497bffb9d7bc0fb083c05bced | [
"MIT"
] | null | null | null | tests/test_blockchain.py | s7p/bitcoingraph | 0d5edf9957db63c497bffb9d7bc0fb083c05bced | [
"MIT"
] | null | null | null | import unittest
from tests.rpc_mock import BitcoinProxyMock
from bitcoingraph.blockchain import Blockchain, BlockchainException
from bitcoingraph.model import Input, Output
BH1 = "000000000002d01c1fccc21636b607dfd930d31d01c3a62104612a1719011250"
BH1_HEIGHT = 99999
BH2 = "000000000003ba27aa200b1cecaad478d2b00432346c3... | 36.492308 | 163 | 0.701518 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.