hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5b51baf3aa9bd02258bb72ec44f30237c71119e9 | 3,456 | py | Python | parallel_merge_sort.py | ursulaabreu/ppd-trabalho1 | 800e1a83ae831fdb53ccce7ade736570934071d5 | [
"MIT"
] | null | null | null | parallel_merge_sort.py | ursulaabreu/ppd-trabalho1 | 800e1a83ae831fdb53ccce7ade736570934071d5 | [
"MIT"
] | null | null | null | parallel_merge_sort.py | ursulaabreu/ppd-trabalho1 | 800e1a83ae831fdb53ccce7ade736570934071d5 | [
"MIT"
] | 1 | 2021-07-28T01:13:35.000Z | 2021-07-28T01:13:35.000Z |
###############################################################################
###############################################################################
###############################################################################
########################################################################... | 30.052174 | 86 | 0.546007 | from contextlib import contextmanager
from multiprocessing import Manager, Pool
import time
class Timer(object):
def __init__(self, *steps):
self._time_per_step = dict.fromkeys(steps)
def __getitem__(self, item):
return self.time_per_step[item]
@property
def time_per_step(self):
... | 0 | 377 | 0 | 344 | 0 | 1,997 | 0 | 26 | 221 |
b85ea8ac7b673002f3d623de61fcc6dc2114e493 | 831 | py | Python | stack.py | efrainc/data_struc_v2 | ffbb5cb3a7d17c7c7720279dcb45d2215dbd6f3f | [
"MIT"
] | null | null | null | stack.py | efrainc/data_struc_v2 | ffbb5cb3a7d17c7c7720279dcb45d2215dbd6f3f | [
"MIT"
] | null | null | null | stack.py | efrainc/data_struc_v2 | ffbb5cb3a7d17c7c7720279dcb45d2215dbd6f3f | [
"MIT"
] | null | null | null | #! /usr/bin/env python
if __name__ == '__main__':
a = node('first')
b = node('second')
c = node('third')
sta = stack()
sta.insert(a)
sta.insert(b)
sta.insert(c)
print sta
sta.remove()
print sta
sta.remove()
print sta
| 18.466667 | 52 | 0.572804 | #! /usr/bin/env python
class node(object):
"""Node container for linked list"""
def __init__(self, data):
# Single linked so only one pointer required
self.pointer = None
self.data = data
class stack(object):
"""Simple Stack Data Structure"""
def __init__(self):
sel... | 0 | 0 | 0 | 514 | 0 | 0 | 0 | 0 | 46 |
01e6b54530e14c5f9c927e4fce615fafafb65fa3 | 527 | py | Python | examples/schelling/model.py | vishalbelsare/neworder | 38635fca64f239a9e8eb1a671872c174e1814678 | [
"MIT"
] | 17 | 2017-12-08T10:21:18.000Z | 2022-01-13T09:29:43.000Z | examples/schelling/model.py | vishalbelsare/neworder | 38635fca64f239a9e8eb1a671872c174e1814678 | [
"MIT"
] | 61 | 2018-07-21T21:37:12.000Z | 2021-07-10T12:49:15.000Z | examples/schelling/model.py | vishalbelsare/neworder | 38635fca64f239a9e8eb1a671872c174e1814678 | [
"MIT"
] | 6 | 2019-06-06T18:29:31.000Z | 2021-08-20T13:32:17.000Z | import numpy as np
import neworder
from schelling import Schelling
#neworder.verbose()
# category 0 is empty
gridsize = [480,360]
categories = np.array([0.36, 0.12, 0.12, 0.4])
# normalise if necessary
# categories = categories / sum(categories)
similarity = 0.6
# open-ended timeline with arbitrary timestep
# the mo... | 25.095238 | 79 | 0.764706 | import numpy as np
import neworder
from schelling import Schelling
#neworder.verbose()
# category 0 is empty
gridsize = [480,360]
categories = np.array([0.36, 0.12, 0.12, 0.4])
# normalise if necessary
# categories = categories / sum(categories)
similarity = 0.6
# open-ended timeline with arbitrary timestep
# the mo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5d8a43cfeefd1ec7c9a4dc4d4685ed87b588150 | 1,545 | py | Python | catalog/bindings/gmd/dynamic_feature_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/dynamic_feature_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/dynamic_feature_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null |
__NAMESPACE__ = "http://www.opengis.net/gml"
| 29.150943 | 66 | 0.6 | from dataclasses import dataclass, field
from typing import Optional
from bindings.gmd.abstract_feature_type import AbstractFeatureType
from bindings.gmd.data_source import DataSource
from bindings.gmd.data_source_reference import DataSourceReference
from bindings.gmd.history import History
from bindings.gmd.track impo... | 0 | 1,100 | 0 | 0 | 0 | 0 | 0 | 199 | 199 |
5c4f3e824bbd5df8f8cb44127ea47edfcc679639 | 8,608 | py | Python | echolect/filtering/filters.py | ryanvolz/echolect | ec2594925f34fdaea69b64e725fccb0c99665a55 | [
"BSD-3-Clause"
] | 1 | 2022-03-24T22:48:12.000Z | 2022-03-24T22:48:12.000Z | echolect/filtering/filters.py | scivision/echolect | ec2594925f34fdaea69b64e725fccb0c99665a55 | [
"BSD-3-Clause"
] | 1 | 2015-03-25T20:41:24.000Z | 2015-03-25T20:41:24.000Z | echolect/filtering/filters.py | scivision/echolect | ec2594925f34fdaea69b64e725fccb0c99665a55 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2014, Ryan Volz
# All rights reserved.
#
# Distributed under the terms of the BSD 3-Clause ("BSD New") license.
#
# The full license is in the LICENSE file, distributed with this software.
#-----------------------------------... | 29.278912 | 108 | 0.55309 | #-----------------------------------------------------------------------------
# Copyright (c) 2014, Ryan Volz
# All rights reserved.
#
# Distributed under the terms of the BSD 3-Clause ("BSD New") license.
#
# The full license is in the LICENSE file, distributed with this software.
#-----------------------------------... | 0 | 1,276 | 0 | 0 | 0 | 5,702 | 0 | 0 | 237 |
f42b9e2e909af7496ad8c30d51f5b7b7782d8249 | 1,012 | py | Python | doc/api_example.py | bmwiedemann/httpolice | 4da2bde3d14a24b0623ee45ae10afd192d6fa771 | [
"MIT"
] | 1,027 | 2016-04-25T11:17:13.000Z | 2022-02-06T23:47:45.000Z | doc/api_example.py | 99/httpolice | 8175020af13708801fbefc8d4f3787b11093c962 | [
"MIT"
] | 9 | 2016-07-25T11:30:34.000Z | 2021-03-23T20:42:29.000Z | doc/api_example.py | 99/httpolice | 8175020af13708801fbefc8d4f3787b11093c962 | [
"MIT"
] | 27 | 2016-05-19T22:17:39.000Z | 2020-09-18T05:53:39.000Z | import io
import httpolice
exchanges = [
httpolice.Exchange(
httpolice.Request(u'https',
u'GET', u'/index.html', u'HTTP/1.1',
[(u'Host', b'example.com')],
b''),
[
httpolice.Response(u'HTTP/1.1', 401, u'Unautho... | 30.666667 | 74 | 0.537549 | import io
import httpolice
exchanges = [
httpolice.Exchange(
httpolice.Request(u'https',
u'GET', u'/index.html', u'HTTP/1.1',
[(u'Host', b'example.com')],
b''),
[
httpolice.Response(u'HTTP/1.1', 401, u'Unautho... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0aabec811943a63ec6b0b1dd4789b782d3da5874 | 2,600 | py | Python | config/urls.py | hqpr/findyour3d | 8ad3d2cb7bd0adfd080bb2314df1c78b94d3973a | [
"MIT"
] | null | null | null | config/urls.py | hqpr/findyour3d | 8ad3d2cb7bd0adfd080bb2314df1c78b94d3973a | [
"MIT"
] | null | null | null | config/urls.py | hqpr/findyour3d | 8ad3d2cb7bd0adfd080bb2314df1c78b94d3973a | [
"MIT"
] | 1 | 2020-11-26T10:52:20.000Z | 2020-11-26T10:52:20.000Z | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
from findyour3d.contact.views import contact
urlpatterns = [
... | 53.061224 | 114 | 0.62 | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
from findyour3d.contact.views import contact
urlpatterns = [
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0186a448b041439390be813bf3fe5a4b69b31958 | 779 | py | Python | pueue/daemon/signals.py | leiz-me/pueue | 1ab3b2d0c6bd0bd1208af97e7ac5a35eac57722b | [
"MIT"
] | null | null | null | pueue/daemon/signals.py | leiz-me/pueue | 1ab3b2d0c6bd0bd1208af97e7ac5a35eac57722b | [
"MIT"
] | null | null | null | pueue/daemon/signals.py | leiz-me/pueue | 1ab3b2d0c6bd0bd1208af97e7ac5a35eac57722b | [
"MIT"
] | null | null | null | """Possible singals, which can be send to a process via `kill`."""
import signal
signals = {
# SigHup
'1': signal.SIGHUP,
'sighup': signal.SIGHUP,
'hup': signal.SIGHUP,
# SigInt
'2': signal.SIGINT,
'sigint': signal.SIGINT,
'int': signal.SIGINT,
# SigQuit
'3': signal.SIGQUIT,
... | 19.475 | 66 | 0.593068 | """Possible singals, which can be send to a process via `kill`."""
import signal
signals = {
# SigHup
'1': signal.SIGHUP,
'sighup': signal.SIGHUP,
'hup': signal.SIGHUP,
# SigInt
'2': signal.SIGINT,
'sigint': signal.SIGINT,
'int': signal.SIGINT,
# SigQuit
'3': signal.SIGQUIT,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5440d6c5f8e0be288839a349b271e8dd38fb733f | 808 | py | Python | bigquery-to-pandas.py | phoenix-w/Useful-Scripts | b9335350273184011d471d0ddfe6604c944537cd | [
"MIT"
] | null | null | null | bigquery-to-pandas.py | phoenix-w/Useful-Scripts | b9335350273184011d471d0ddfe6604c944537cd | [
"MIT"
] | null | null | null | bigquery-to-pandas.py | phoenix-w/Useful-Scripts | b9335350273184011d471d0ddfe6604c944537cd | [
"MIT"
] | null | null | null | # code for accessing BigQuery locally
if __name__ == "__main__":
client = main()
# run a query and save the output as a data frame
df = client.query(
"""
YOUR-BigQuery-QUERY-GOES-HERE
"""
).to_dataframe() | 29.925926 | 86 | 0.726485 | # code for accessing BigQuery locally
import os
def main():
from google.cloud import bigquery
from google.oauth2 import service_account
# follow the steps here to download a JSON file that contains your key
# https://cloud.google.com/docs/authentication/production#create_service_account
path = "LO... | 0 | 0 | 0 | 0 | 0 | 528 | 0 | -14 | 67 |
8a8b6576ed46ffe7da30d0c60151ce34b09c49dc | 3,549 | py | Python | setup.py | maresb/lattice | 2d68635da7455dc9e36161aebba58a7062682d98 | [
"Apache-2.0"
] | null | null | null | setup.py | maresb/lattice | 2d68635da7455dc9e36161aebba58a7062682d98 | [
"Apache-2.0"
] | null | null | null | setup.py | maresb/lattice | 2d68635da7455dc9e36161aebba58a7062682d98 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Lattice Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 33.481132 | 80 | 0.714004 | # Copyright 2018 The TensorFlow Lattice Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
24f4d56b8bc678cd4f32e31df6a18f5a5df1403e | 601 | py | Python | djangoProject/api/migrations/0005_auto_20201209_1906.py | skygxsky/invitation_system | b6b345e4fc7116b64c509c75753fafa4b2d1f02c | [
"MIT"
] | null | null | null | djangoProject/api/migrations/0005_auto_20201209_1906.py | skygxsky/invitation_system | b6b345e4fc7116b64c509c75753fafa4b2d1f02c | [
"MIT"
] | null | null | null | djangoProject/api/migrations/0005_auto_20201209_1906.py | skygxsky/invitation_system | b6b345e4fc7116b64c509c75753fafa4b2d1f02c | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2020-12-09 11:06
| 25.041667 | 81 | 0.590682 | # Generated by Django 3.1.4 on 2020-12-09 11:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0004_auto_20201209_1905'),
]
operations = [
migrations.AlterField(
model_name='userinfo',
name='phone',
... | 18 | 0 | 0 | 481 | 0 | 0 | 0 | 19 | 46 |
b58d5085506d6c967f0ecf03489928a9c483d62e | 2,886 | py | Python | speech/packages/chatbot/text_to_idea.py | sprtkd/OpenHmnD | 361a5751824292e507b03c4b90e5f64564e8eb0e | [
"MIT"
] | 2 | 2017-08-01T19:56:52.000Z | 2018-06-15T01:57:36.000Z | speech/packages/chatbot/text_to_idea.py | sprtkd/OpenHmnD | 361a5751824292e507b03c4b90e5f64564e8eb0e | [
"MIT"
] | 2 | 2017-07-30T06:42:34.000Z | 2017-07-30T06:50:19.000Z | speech/packages/chatbot/text_to_idea.py | sprtkd/OpenHmnD | 361a5751824292e507b03c4b90e5f64564e8eb0e | [
"MIT"
] | 4 | 2017-07-28T18:38:48.000Z | 2017-08-06T20:07:24.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 25 18:17:38 2017
@author: Punyajoy Saha
"""
#from rasa_nlu.converters import load_data
#from rasa_nlu.config import RasaNLUConfig
#from rasa_nlu.model import Trainer
#
#training_data = load_data('data/examples/rasa/demo-rasa.json')
#trainer = Trainer(RasaNLUC... | 28.019417 | 97 | 0.691268 | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 25 18:17:38 2017
@author: Punyajoy Saha
"""
#from rasa_nlu.converters import load_data
#from rasa_nlu.config import RasaNLUConfig
#from rasa_nlu.model import Trainer
#
#training_data = load_data('data/examples/rasa/demo-rasa.json')
#trainer = Trainer(RasaNLUC... | 0 | 0 | 0 | 0 | 0 | 108 | 0 | 0 | 29 |
023c5bcef128b6dc2e63ff88bad5e1fd9552349e | 6,208 | py | Python | amiq_sv_python_non_blocking_socket_communication_in_systemverilog_using_dpi_c/server.py | cristianbob/amiq_blog | 184ddc8759c57268d8d4ffa552b3e57d22478247 | [
"Apache-2.0"
] | 23 | 2018-05-01T06:45:00.000Z | 2022-03-23T09:49:09.000Z | amiq_sv_python_non_blocking_socket_communication_in_systemverilog_using_dpi_c/server.py | cristianbob/amiq_blog | 184ddc8759c57268d8d4ffa552b3e57d22478247 | [
"Apache-2.0"
] | 3 | 2019-05-06T15:41:12.000Z | 2021-12-14T14:04:51.000Z | amiq_sv_python_non_blocking_socket_communication_in_systemverilog_using_dpi_c/server.py | cristianbob/amiq_blog | 184ddc8759c57268d8d4ffa552b3e57d22478247 | [
"Apache-2.0"
] | 30 | 2017-10-18T12:36:07.000Z | 2022-03-28T15:09:01.000Z | # /******************************************************************************
# * (C) Copyright 2020 AMIQ Consulting
# *
# * 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:/... | 40.575163 | 121 | 0.487597 | # /******************************************************************************
# * (C) Copyright 2020 AMIQ Consulting
# *
# * 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:/... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -4 | 88 |
bff4c69566b1181f069146caee9bbbfea9324660 | 5,490 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/63a1/src/iterative_sorting/iterative_sorting.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/63a1/src/iterative_sorting/iterative_sorting.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/63a1/src/iterative_sorting/iterative_sorting.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # TODO: Complete the selection_sort() function below
# os.chdir("E:\\projects\\LambdaSchool\\m6\\63a1\\src\\iterative_sorting\")
# exec(open("iterative_sorting.py").read())
def selection_sort(arr):
'''
procedure selection sort
arr : array of items
arraylength : size of ar... | 28.59375 | 88 | 0.5 | # TODO: Complete the selection_sort() function below
# os.chdir("E:\\projects\\LambdaSchool\\m6\\63a1\\src\\iterative_sorting\")
# exec(open("iterative_sorting.py").read())
def selection_sort(arr):
'''
procedure selection sort
arr : array of items
arraylength : size of ar... | 0 | 0 | 0 | 0 | 0 | 1,981 | 0 | 0 | 22 |
1d279cd97b22f47f53a00829342b4a64e9835eac | 547 | py | Python | tf_encrypted/keras/engine/input_layer_test.py | wqruan/tf-encrypted | 50ee4ae3ba76b7c1f70a90e18f875191adea0a07 | [
"Apache-2.0"
] | 825 | 2019-04-18T09:21:32.000Z | 2022-03-30T05:55:26.000Z | tf_encrypted/keras/engine/input_layer_test.py | wqruan/tf-encrypted | 50ee4ae3ba76b7c1f70a90e18f875191adea0a07 | [
"Apache-2.0"
] | 354 | 2019-04-18T08:42:40.000Z | 2022-03-31T18:06:31.000Z | tf_encrypted/keras/engine/input_layer_test.py | wqruan/tf-encrypted | 50ee4ae3ba76b7c1f70a90e18f875191adea0a07 | [
"Apache-2.0"
] | 161 | 2019-05-02T16:43:31.000Z | 2022-03-31T01:35:03.000Z | # pylint: disable=missing-docstring
import unittest
import numpy as np
np.random.seed(42)
if __name__ == "__main__":
unittest.main()
| 20.259259 | 55 | 0.674589 | # pylint: disable=missing-docstring
import unittest
import numpy as np
import tensorflow as tf
import tf_encrypted as tfe
from tf_encrypted.keras.engine.input_layer import Input
np.random.seed(42)
class TestInput(unittest.TestCase):
def setUp(self):
tf.reset_default_graph()
def test_input(self):
... | 0 | 0 | 0 | 274 | 0 | 0 | 0 | 41 | 90 |
7f843d30b13a3647cc3d81aae520204805a2fafc | 3,424 | py | Python | Update.py | errordimension/errordimension | 24668bd2bfa199909410b441256dfbe0f39087ea | [
"MIT"
] | 4 | 2021-08-20T06:56:43.000Z | 2021-08-22T05:20:21.000Z | Update.py | ErrorDimension/ErrorDimension | 3baab3d6e1c1acd586d55b96117b207a001a1e61 | [
"MIT"
] | null | null | null | Update.py | ErrorDimension/ErrorDimension | 3baab3d6e1c1acd586d55b96117b207a001a1e61 | [
"MIT"
] | 1 | 2021-08-28T08:40:05.000Z | 2021-08-28T08:40:05.000Z | import requests
import json
from time import perf_counter
import colorama
from lib.log import log
colorama.init()
log("OKAY", "Imported: colorama")
log("OKAY", "Imported: datetime.datetime")
log("OKAY", "Imported: pytz")
log("OKAY", "Imported: time.perf_counter")
log("OKAY", "Imported: requests")
log("OKAY", "Importe... | 26.542636 | 230 | 0.629381 | from datetime import datetime
import pytz
import requests
import json
from time import perf_counter, time
import lib
import colorama
from colorama import Fore
from lib import ehook
from lib.log import log
colorama.init()
log("OKAY", "Imported: colorama")
log("OKAY", "Imported: datetime.datetime")
log("OKAY", "Importe... | 19 | 0 | 0 | 0 | 0 | 1,297 | 0 | -3 | 271 |
832a4e4151ab0ea68d9e0028d4ebe5b08667da01 | 3,699 | py | Python | nwbwidgets/spectrum.py | NeurodataWithoutBorders/nwb-jupyter-widgets | 0d11e5d7b193c53d744b13c6404186ac84f4a5c1 | [
"BSD-3-Clause-LBNL"
] | 35 | 2019-03-10T23:39:17.000Z | 2021-11-16T11:50:33.000Z | nwbwidgets/spectrum.py | catalystneuro/nwb-jupyter-widgets | 0d11e5d7b193c53d744b13c6404186ac84f4a5c1 | [
"BSD-3-Clause-LBNL"
] | 158 | 2019-03-12T21:40:24.000Z | 2022-03-16T14:35:55.000Z | nwbwidgets/spectrum.py | catalystneuro/nwb-jupyter-widgets | 0d11e5d7b193c53d744b13c6404186ac84f4a5c1 | [
"BSD-3-Clause-LBNL"
] | 20 | 2019-03-08T14:30:27.000Z | 2021-11-08T16:31:26.000Z | import matplotlib.pyplot as plt
import numpy as np
def plot_spectrum_figure(spectrum, channel_nos, frequency_nos):
"""
Plot power vs frequencies and/or phase vs frequencies.
Parameters
----------
spectrum: Spectrum
channel_nos: tuple
Input from the channel range slider widget: (channe... | 35.228571 | 88 | 0.638821 | import matplotlib.pyplot as plt
import numpy as np
from ipywidgets import widgets
from ndx_spectrum import Spectrum
def show_spectrum(node: Spectrum, **kwargs) -> widgets.Widget:
check_spectrum(node)
data = node.power if "power" in node.fields else node.phase
if len(data.shape) == 2:
no_channels =... | 0 | 0 | 0 | 0 | 0 | 1,618 | 0 | 21 | 90 |
111f8861f8a268462a9c22cdca35e2db764c3102 | 16,873 | py | Python | crypto_futures_py/binance_futures.py | bear2u/CryptoFuturesPy | 9cfbf5f3a32b35a8a7cd53c2a3ded55d7b3c78d0 | [
"MIT"
] | 7 | 2020-08-23T19:02:33.000Z | 2022-03-24T15:48:18.000Z | crypto_futures_py/binance_futures.py | bear2u/CryptoFuturesPy | 9cfbf5f3a32b35a8a7cd53c2a3ded55d7b3c78d0 | [
"MIT"
] | null | null | null | crypto_futures_py/binance_futures.py | bear2u/CryptoFuturesPy | 9cfbf5f3a32b35a8a7cd53c2a3ded55d7b3c78d0 | [
"MIT"
] | 1 | 2021-09-15T04:17:04.000Z | 2021-09-15T04:17:04.000Z | """
This module contains an implementation for Binance Futures (BinanceFuturesExchangeHandler)
"""
from __future__ import annotations
import pandas as pd
| 37.412417 | 122 | 0.551295 | """
This module contains an implementation for Binance Futures (BinanceFuturesExchangeHandler)
"""
from __future__ import annotations
import pandas as pd
import typing
import json
import logging
import pandas as pd
from datetime import datetime
from dataclasses import dataclass
from . import futurespy as fp
from... | 0 | 425 | 8,572 | 7,498 | 0 | 0 | 0 | 17 | 201 |
ac884fac4b4ad300f4213bf7b99c0cbbf3293a3a | 1,441 | py | Python | CIS41B/Assignments/assignment3_t4.py | jackh423/python | 4187c16a1d6c1269d188a4a039e0a16020de51d0 | [
"Apache-2.0"
] | 1 | 2021-09-08T18:34:56.000Z | 2021-09-08T18:34:56.000Z | CIS41B/Assignments/assignment3_t4.py | jackh423/python | 4187c16a1d6c1269d188a4a039e0a16020de51d0 | [
"Apache-2.0"
] | null | null | null | CIS41B/Assignments/assignment3_t4.py | jackh423/python | 4187c16a1d6c1269d188a4a039e0a16020de51d0 | [
"Apache-2.0"
] | null | null | null | import queue
SITE_NAME = "https://www.esrl.noaa.gov/gmd/aggi/aggi.html"
threadList = ["CO2", "CH4", "N2O", "CFC12", "CFC11", "15-minor"]
exitFlag = False
# threadList = ["Thread-1", "Thread-2", "Thread-3"]
threadList = ["CO2", "CH4", "N2O", "CFC12", "CFC11", "15-minor"]
# nameList = ["A", "B", "C", "D", "E", "F", "... | 24.844828 | 64 | 0.636364 | import queue
import threading
import time
from urllib.request import urlopen
from bs4 import BeautifulSoup
SITE_NAME = "https://www.esrl.noaa.gov/gmd/aggi/aggi.html"
threadList = ["CO2", "CH4", "N2O", "CFC12", "CFC11", "15-minor"]
exitFlag = False
def processData(threadName, q):
while not exitFlag:
if no... | 0 | 0 | 0 | 267 | 0 | 176 | 0 | 6 | 134 |
7089cc4f0b349788f98e48f4bc5ad70da741659c | 484 | py | Python | Chapter02/function-working.py | JeffreyAsuncion/PythonEssentialTraining | adf9164ac01db35f2f657e58ec60d9bcc197dcda | [
"MIT"
] | null | null | null | Chapter02/function-working.py | JeffreyAsuncion/PythonEssentialTraining | adf9164ac01db35f2f657e58ec60d9bcc197dcda | [
"MIT"
] | null | null | null | Chapter02/function-working.py | JeffreyAsuncion/PythonEssentialTraining | adf9164ac01db35f2f657e58ec60d9bcc197dcda | [
"MIT"
] | null | null | null | #!/home/jepoy/anaconda3/bin/python
## at terminal which python
function(47)
list_primes()
n = 5
if isprime(n):
print(f'{n} is prime')
else:
print(f'{n} not prime') | 16.133333 | 41 | 0.541322 | #!/home/jepoy/anaconda3/bin/python
## at terminal which python
def function(n):
print(n)
function(47)
def isprime(n):
if n <= 1:
return False
for x in range(2, n):
if n % x == 0:
return False
else:
return True
def list_primes():
for n in range(100):
if... | 0 | 0 | 0 | 0 | 0 | 241 | 0 | 0 | 69 |
c54428d22cf2cc86b1658d5448a25fcdaa354ccf | 843 | py | Python | text_office/apps.py | pkaczynski/django-text_office | 07c52ad6f8955c11cf79e4a99e45d46c1b440345 | [
"MIT"
] | null | null | null | text_office/apps.py | pkaczynski/django-text_office | 07c52ad6f8955c11cf79e4a99e45d46c1b440345 | [
"MIT"
] | null | null | null | text_office/apps.py | pkaczynski/django-text_office | 07c52ad6f8955c11cf79e4a99e45d46c1b440345 | [
"MIT"
] | 1 | 2021-08-09T22:54:22.000Z | 2021-08-09T22:54:22.000Z | from __future__ import unicode_literals
| 29.068966 | 70 | 0.650059 | from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.apps import AppConfig, apps as django_apps
from django.conf import settings
from django.core.checks import Error, register
class TextOfficeConfig(AppConfig):
name = 'text_office'
verbose_name = 'Text ... | 0 | 491 | 0 | 71 | 0 | 0 | 0 | 103 | 136 |
21184f01ce738d95c71570af3f43f6ac70b35d6d | 11,712 | py | Python | frgpascal/experimentaldesign/test_batching.py | fenning-research-group/PASCAL | c175e60ec2015ac8dce1ed3ae037619072d48cea | [
"MIT"
] | 1 | 2022-02-11T22:31:32.000Z | 2022-02-11T22:31:32.000Z | frgpascal/experimentaldesign/test_batching.py | fenning-research-group/PASCAL | c175e60ec2015ac8dce1ed3ae037619072d48cea | [
"MIT"
] | 7 | 2021-05-06T16:07:51.000Z | 2021-08-07T15:18:06.000Z | frgpascal/experimentaldesign/test_batching.py | fenning-research-group/PASCAL | c175e60ec2015ac8dce1ed3ae037619072d48cea | [
"MIT"
] | 1 | 2021-12-11T00:42:33.000Z | 2021-12-11T00:42:33.000Z |
speedup_factor = 50
| 35.92638 | 92 | 0.592469 | import json
import asyncio
from abc import ABC, abstractmethod
from threading import Lock, Thread
import time
from functools import partial
import numpy as np
from concurrent.futures import ThreadPoolExecutor
speedup_factor = 50
def load_netlist(filename):
with open(filename) as f:
netlist = json.load(f)... | 0 | 0 | 5,039 | 5,992 | 0 | 235 | 0 | 33 | 383 |
627ecf2f8b0e83fc8c01bca7b2bbaec3a02e4e43 | 1,298 | py | Python | 00_create_data.py | PauSempere-SQ/AzureMLServices | 34006e0f261e497a9e32a6d71b480e8e2e0206b2 | [
"MIT"
] | null | null | null | 00_create_data.py | PauSempere-SQ/AzureMLServices | 34006e0f261e497a9e32a6d71b480e8e2e0206b2 | [
"MIT"
] | null | null | null | 00_create_data.py | PauSempere-SQ/AzureMLServices | 34006e0f261e497a9e32a6d71b480e8e2e0206b2 | [
"MIT"
] | null | null | null | from sklearn import datasets
import pandas as pd
X, y = datasets.load_wine(return_X_y=True)
df_to_save = pd.DataFrame(X)
df_to_save['Class'] = y
columns = ['Alcohol', 'Malic Acid', 'Ash', 'Alcalinity of Ash', 'Magnesium',
'Total Phenols', 'Flavonoids', 'Nonflavonoid phenols', 'Proanthocyanins',
'Color inte... | 28.844444 | 84 | 0.75963 | from sklearn import datasets
import pandas as pd
import numpy as np
X, y = datasets.load_wine(return_X_y=True)
df_to_save = pd.DataFrame(X)
df_to_save['Class'] = y
columns = ['Alcohol', 'Malic Acid', 'Ash', 'Alcalinity of Ash', 'Magnesium',
'Total Phenols', 'Flavonoids', 'Nonflavonoid phenols', 'Proanthocyanin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 23 |
278fd34af1a7e817012c27f38647f9ce76f0c803 | 889 | py | Python | legacy/ssd/visual.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 4 | 2020-01-04T13:15:02.000Z | 2021-07-21T07:50:02.000Z | legacy/ssd/visual.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 2 | 2019-06-26T03:21:49.000Z | 2019-09-19T09:43:42.000Z | legacy/ssd/visual.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 3 | 2019-10-31T07:18:49.000Z | 2020-01-13T03:18:39.000Z | import cv2
import os
data_dir = './data'
infer_file = './infer.res'
out_dir = './visual_res'
path_to_im = dict()
for line in open(infer_file):
img_path, _, _, _ = line.strip().split('\t')
if img_path not in path_to_im:
im = cv2.imread(os.path.join(data_dir, img_path))
path_to_im[img_path] = i... | 26.147059 | 64 | 0.622047 | import cv2
import os
data_dir = './data'
infer_file = './infer.res'
out_dir = './visual_res'
path_to_im = dict()
for line in open(infer_file):
img_path, _, _, _ = line.strip().split('\t')
if img_path not in path_to_im:
im = cv2.imread(os.path.join(data_dir, img_path))
path_to_im[img_path] = i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8e3459e461657ac976b8f92eec83934c2a841215 | 417 | py | Python | CursoEmVideo/ex026.py | EduardoArgenti/Python | 18b4578033d6eb6fb0ae2d6a8511a4a813856203 | [
"MIT"
] | null | null | null | CursoEmVideo/ex026.py | EduardoArgenti/Python | 18b4578033d6eb6fb0ae2d6a8511a4a813856203 | [
"MIT"
] | null | null | null | CursoEmVideo/ex026.py | EduardoArgenti/Python | 18b4578033d6eb6fb0ae2d6a8511a4a813856203 | [
"MIT"
] | null | null | null | # Faa um programa que leia uma frase pelo teclado e mostre:
# - Quantas vezes aparece a letra "a"
# - Em que posio ela aparece a primeira vez
# - Em que posio ela aparece a ltima vez
frase = input('Digite uma frase: ')
print('\nAnalisando...')
print(f'"A" aparece {frase.lower().count("a")} vez(es)')
print(f'Primeira ... | 37.909091 | 60 | 0.678657 | # Faça um programa que leia uma frase pelo teclado e mostre:
# - Quantas vezes aparece a letra "a"
# - Em que posição ela aparece a primeira vez
# - Em que posição ela aparece a última vez
frase = input('Digite uma frase: ')
print('\nAnalisando...')
print(f'"A" aparece {frase.lower().count("a")} vez(es)')
print(f'Pri... | 14 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8bca2c72ac55977d81e8681d769f8dde8e7aa479 | 12,157 | py | Python | tests/test_base.py | trytonus/trytond-magento | f27e8d136e5e222fdf86b679d10d468de38262eb | [
"BSD-3-Clause"
] | 3 | 2015-10-07T15:51:40.000Z | 2016-04-06T09:00:57.000Z | tests/test_base.py | trytonus/trytond-magento | f27e8d136e5e222fdf86b679d10d468de38262eb | [
"BSD-3-Clause"
] | 19 | 2015-07-28T14:24:24.000Z | 2016-07-13T06:02:35.000Z | tests/test_base.py | trytonus/trytond-magento | f27e8d136e5e222fdf86b679d10d468de38262eb | [
"BSD-3-Clause"
] | 15 | 2015-07-28T05:54:17.000Z | 2016-05-27T12:23:29.000Z | # -*- coding: utf-8 -*-
import os
import json
ROOT_JSON_FOLDER = os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'json_mock'
)
def load_json(resource, filename):
"""Reads the json file from the filesystem and returns the json loaded as
python objects
On filesystem, the files are kept in t... | 35.546784 | 78 | 0.513449 | # -*- coding: utf-8 -*-
import os
from decimal import Decimal
import json
import unittest
from datetime import datetime
from dateutil.relativedelta import relativedelta
import trytond.tests.test_tryton
from trytond.tests.test_tryton import POOL, USER
from trytond.transaction import Transaction
from trytond.pyson impor... | 0 | 0 | 0 | 10,901 | 0 | 0 | 0 | 104 | 200 |
dde5c4d550e8f8004cc551619e131716af7b357c | 1,307 | py | Python | archive/macs21csv_to_HOMERbed.py | dkdeconti/sRNAPeaks | 8f83afe60f98a70d8bc0cc733e8dac7017ab6bb4 | [
"MIT"
] | 1 | 2021-02-04T12:47:26.000Z | 2021-02-04T12:47:26.000Z | archive/macs21csv_to_HOMERbed.py | dkdeconti/sRNAPeaks | 8f83afe60f98a70d8bc0cc733e8dac7017ab6bb4 | [
"MIT"
] | null | null | null | archive/macs21csv_to_HOMERbed.py | dkdeconti/sRNAPeaks | 8f83afe60f98a70d8bc0cc733e8dac7017ab6bb4 | [
"MIT"
] | null | null | null | #! /usr/bin/python
import sys
if __name__ == "__main__":
main(sys.argv[1:])
| 23.763636 | 65 | 0.488906 | #! /usr/bin/python
import sys
def parse_header(handle):
header = handle.readline().strip('\n').strip(',')
if header[0] == "#":
while len(header) == 0 or header[0] == "#":
header = handle.readline().strip('\n').strip(',')
sys.stdout.write('#' + header + '\n')
def parse_line(line):
... | 0 | 0 | 0 | 0 | 0 | 1,104 | 0 | 0 | 115 |
b4954ebbe38426ef14f0c48d0939e47dc8ef64d4 | 1,450 | py | Python | src/hcb/artifacts/make_qubit_count_plot.py | Strilanc/honeycomb-boundaries | cc33baac44c7831bd643db81d0053f8ec6eae9d8 | [
"Apache-2.0"
] | null | null | null | src/hcb/artifacts/make_qubit_count_plot.py | Strilanc/honeycomb-boundaries | cc33baac44c7831bd643db81d0053f8ec6eae9d8 | [
"Apache-2.0"
] | 2 | 2022-02-25T22:28:24.000Z | 2022-03-23T21:09:04.000Z | src/hcb/artifacts/make_qubit_count_plot.py | Strilanc/honeycomb-boundaries | cc33baac44c7831bd643db81d0053f8ec6eae9d8 | [
"Apache-2.0"
] | null | null | null | import pathlib
import matplotlib.colors as mcolors
OUT_DIR = pathlib.Path(__file__).parent.parent.parent.parent / "out"
MARKERS = "ov*sp^<>8PhH+xXDd|" * 100
COLORS = list(mcolors.TABLEAU_COLORS) * 3
if __name__ == '__main__':
main()
| 26.363636 | 93 | 0.583448 | import pathlib
import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
from hcb.codes.honeycomb.layout import HoneycombLayout
OUT_DIR = pathlib.Path(__file__).parent.parent.parent.parent / "out"
MARKERS = "ov*sp^<>8PhH+xXDd|" * 100
COLORS = list(mcolors.TABLEAU_COLORS) * 3
def main():
gate_sets = ... | 0 | 0 | 0 | 0 | 0 | 1,096 | 0 | 43 | 68 |
e7df75299fce5240f01c4d780034e2543c3f49a9 | 1,041 | py | Python | fragmenter/tests/test_adjacency.py | kristianeschenburg/parcellation_fragmenter | 9928db6697c80ce2f334305cca62031414a6181a | [
"BSD-3-Clause"
] | 19 | 2018-07-19T16:11:51.000Z | 2022-03-14T01:59:04.000Z | fragmenter/tests/test_adjacency.py | kristianeschenburg/parcellation_fragmenter | 9928db6697c80ce2f334305cca62031414a6181a | [
"BSD-3-Clause"
] | 32 | 2018-07-19T19:38:53.000Z | 2020-09-27T21:14:36.000Z | fragmenter/tests/test_adjacency.py | kristianeschenburg/parcellation_fragmenter | 9928db6697c80ce2f334305cca62031414a6181a | [
"BSD-3-Clause"
] | 13 | 2018-07-19T22:04:33.000Z | 2020-04-06T06:35:03.000Z | from fragmenter import adjacency
import numpy as np
FACES = np.asarray([
[0, 1, 2], [0, 1, 3], [1, 0, 2], [1, 3, 0],
[1, 2, 4], [1, 2, 5], [2, 0, 1], [2, 1, 4],
[2, 1, 5], [3, 0, 1], [4, 1, 2], [5, 1, 2]])
VERTICES = np.zeros((6, 3))
ADJ_LIST = {
0: [1, 2, 3],
1: [0, 2, 3, 4, 5],
2: [0, 1, 4,... | 20.019231 | 76 | 0.522574 | from fragmenter import adjacency
import numpy as np
FACES = np.asarray([
[0, 1, 2], [0, 1, 3], [1, 0, 2], [1, 3, 0],
[1, 2, 4], [1, 2, 5], [2, 0, 1], [2, 1, 4],
[2, 1, 5], [3, 0, 1], [4, 1, 2], [5, 1, 2]])
VERTICES = np.zeros((6, 3))
ADJ_LIST = {
0: [1, 2, 3],
1: [0, 2, 3, 4, 5],
2: [0, 1, 4,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ef17a1b001d220abaac815362070063ee2e26eba | 2,138 | py | Python | randbeacon/input_processing/merkle.py | randomchain/randbeacon | 449b1ad387a526fafc3076c35c672c97006ee5d5 | [
"MIT"
] | 1 | 2018-04-08T16:24:57.000Z | 2018-04-08T16:24:57.000Z | randbeacon/input_processing/merkle.py | randomchain/randbeacon | 449b1ad387a526fafc3076c35c672c97006ee5d5 | [
"MIT"
] | 9 | 2018-04-08T16:11:43.000Z | 2018-06-01T13:32:16.000Z | randbeacon/input_processing/merkle.py | randomchain/randbeacon | 449b1ad387a526fafc3076c35c672c97006ee5d5 | [
"MIT"
] | null | null | null | from logbook import Logger
log = Logger('Merkle')
if __name__ == "__main__":
main(auto_envvar_prefix="INPUT_PROCESSOR_MERKLE")
| 32.892308 | 118 | 0.683349 | import sys
import click
import msgpack
from logbook import Logger, StreamHandler
from merkletools import MerkleTools
from .base import BaseInputProcessor
log = Logger('Merkle')
class MerkleInputProcessor(BaseInputProcessor):
def __init__(self, *, hash_algo, **kwargs):
super().__init__(hash_algo=hash_algo... | 0 | 1,067 | 0 | 762 | 0 | 0 | 0 | 17 | 156 |
4a8bc165aff8dd4c3b3bbedf82720de3555b4627 | 2,498 | py | Python | src/cmd_lampe.py | guillaume-havard/com_elements_gui | 3d21d248b495dc3698f609d7564943163eeb81d7 | [
"MIT"
] | null | null | null | src/cmd_lampe.py | guillaume-havard/com_elements_gui | 3d21d248b495dc3698f609d7564943163eeb81d7 | [
"MIT"
] | 14 | 2015-01-06T10:13:21.000Z | 2015-01-23T14:49:06.000Z | src/cmd_lampe.py | guillaume-havard/com_elements_gui | 3d21d248b495dc3698f609d7564943163eeb81d7 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Copyright (c) 2014 Guillaume Havard - BVS
"""
import time
import serial
import signal
port = serial.Serial("/dev/ttyAMA0",
baudrate=115200,
timeout=0,
parity=serial.PARITY_NONE,
stopbits=seria... | 23.345794 | 76 | 0.461569 | #!/usr/bin/python3
"""
Copyright (c) 2014 Guillaume Havard - BVS
"""
import sys
import os
import time
import serial
import signal
port = serial.Serial("/dev/ttyAMA0",
baudrate=115200,
timeout=0,
parity=serial.PARITY_NONE,
... | 0 | 0 | 0 | 0 | 0 | 275 | 0 | -23 | 92 |
4e2fa6599180a9de69c94115c7f1b1adf84853dc | 770 | py | Python | api/storaging/migrations/0001_initial.py | selelab/admin | d858209da3b7efc4501d503968402268d3f689f8 | [
"BSD-3-Clause"
] | null | null | null | api/storaging/migrations/0001_initial.py | selelab/admin | d858209da3b7efc4501d503968402268d3f689f8 | [
"BSD-3-Clause"
] | 17 | 2020-03-27T14:18:46.000Z | 2022-02-27T01:24:58.000Z | api/storaging/migrations/0001_initial.py | selelab/admin | d858209da3b7efc4501d503968402268d3f689f8 | [
"BSD-3-Clause"
] | 1 | 2020-02-26T09:09:07.000Z | 2020-02-26T09:09:07.000Z | # Generated by Django 3.0.5 on 2020-04-17 08:11
| 27.5 | 112 | 0.581818 | # Generated by Django 3.0.5 on 2020-04-17 08:11
from django.db import migrations, models
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Medium',
fields=[
... | 0 | 0 | 0 | 615 | 0 | 0 | 0 | 16 | 90 |
5e2dfcf38c1df29decc962b43d31dc02ceb015c5 | 6,955 | py | Python | pytorch_pretrained_bert/create_pretraining_data.py | harmdevries89/pytorch-pretrained-BERT | acd04eacc87ffdc666d4104958e2700785003380 | [
"Apache-2.0"
] | null | null | null | pytorch_pretrained_bert/create_pretraining_data.py | harmdevries89/pytorch-pretrained-BERT | acd04eacc87ffdc666d4104958e2700785003380 | [
"Apache-2.0"
] | null | null | null | pytorch_pretrained_bert/create_pretraining_data.py | harmdevries89/pytorch-pretrained-BERT | acd04eacc87ffdc666d4104958e2700785003380 | [
"Apache-2.0"
] | null | null | null | import json
import random
import tqdm
import multiprocessing as mp
from multiprocessing import Pool
from tokenization import BertTokenizer
tokenizer = BertTokenizer.from_pretrained('bert-large-uncased', cache_dir='./data')
rng = random.Random()
def create_instances_from_document(document_index, max_seq_length=128, ... | 39.742857 | 136 | 0.608914 | import json
import random
import os
import time
import tqdm
import copy
import sys
import multiprocessing as mp
from multiprocessing import Pool
from tokenization import BertTokenizer
tokenizer = BertTokenizer.from_pretrained('bert-large-uncased', cache_dir='./data')
rng = random.Random()
def get_wiki_docs(wiki_pat... | 0 | 0 | 0 | 0 | 0 | 683 | 0 | -43 | 157 |
c81fe6ca6808e60dfe4b8dd32ea47ae380ccbcee | 5,400 | py | Python | tests/test_exception_handling.py | DiamondLightSource/python-bluesky-taskgraph | 7d843b84b2b9618399e63c2e5c7ab2ad3f010dc2 | [
"Apache-2.0"
] | null | null | null | tests/test_exception_handling.py | DiamondLightSource/python-bluesky-taskgraph | 7d843b84b2b9618399e63c2e5c7ab2ad3f010dc2 | [
"Apache-2.0"
] | null | null | null | tests/test_exception_handling.py | DiamondLightSource/python-bluesky-taskgraph | 7d843b84b2b9618399e63c2e5c7ab2ad3f010dc2 | [
"Apache-2.0"
] | 1 | 2022-02-22T08:30:10.000Z | 2022-02-22T08:30:10.000Z |
# TODO: Breaks after one
# def test_same_non_fatal_error_n_times_breaks_from_loop():
# re = RunEngine({})
# broken_device = mock_device(FailingDevice("Sticky motor", fatal_exception=False))
# working_device = mock_device(name="Counting device")
# control = FailingDecisionEngineControlObject(re,
# ... | 38.571429 | 87 | 0.606296 | from typing import Any, Dict
from unittest.mock import call
from bluesky import RunEngine
from bluesky.suspenders import SuspendCeil
from mocks import mock_device
from ophyd import DeviceStatus, Signal
from ophyd.sim import SynAxis
from ophyd.utils import DestroyedError
from python_bluesky_taskgraph.core.decision_eng... | 0 | 0 | 0 | 1,909 | 0 | 747 | 0 | 284 | 358 |
963ee08e1e4759634f5a2655aba9fb0915fb9647 | 2,333 | py | Python | core/polyaxon/tracking/contrib/keras.py | jjasonkal/polyaxon | 8454b29b2b971b965de8a7bf63afdd48f07d6d53 | [
"Apache-2.0"
] | null | null | null | core/polyaxon/tracking/contrib/keras.py | jjasonkal/polyaxon | 8454b29b2b971b965de8a7bf63afdd48f07d6d53 | [
"Apache-2.0"
] | null | null | null | core/polyaxon/tracking/contrib/keras.py | jjasonkal/polyaxon | 8454b29b2b971b965de8a7bf63afdd48f07d6d53 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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 ... | 32.859155 | 89 | 0.68024 | #!/usr/bin/python
#
# Copyright 2018-2020 Polyaxon, 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 ... | 0 | 0 | 0 | 1,147 | 0 | 0 | 0 | 86 | 151 |
830e2623c74c6ddd09d1cb655a40a56881491249 | 4,968 | py | Python | gcn/Preprocess/load_unprocessed_graph.py | Patrickgsheng/GCN_detection_benchmark | ded59653accc61aeeb8e437c2ea9203e4fe9e500 | [
"MIT"
] | null | null | null | gcn/Preprocess/load_unprocessed_graph.py | Patrickgsheng/GCN_detection_benchmark | ded59653accc61aeeb8e437c2ea9203e4fe9e500 | [
"MIT"
] | 4 | 2020-01-28T23:06:19.000Z | 2022-02-10T00:45:00.000Z | gcn/Preprocess/load_unprocessed_graph.py | Patrickgsheng/GCN_detection_benchmark | ded59653accc61aeeb8e437c2ea9203e4fe9e500 | [
"MIT"
] | 1 | 2019-11-16T14:55:22.000Z | 2019-11-16T14:55:22.000Z |
import networkx as nx
version_info = list(map(int, nx.__version__.split('.')))
major = version_info[0]
minor = version_info[1]
assert (major <= 1) and (minor <= 11), "networkx major version > 1.11" | 40.064516 | 160 | 0.634461 | import numpy as np
import random
import json
import sys
import os
import networkx as nx
from networkx.readwrite import json_graph
version_info = list(map(int, nx.__version__.split('.')))
major = version_info[0]
minor = version_info[1]
assert (major <= 1) and (minor <= 11), "networkx major version > 1.11"
def load_unp... | 0 | 0 | 0 | 0 | 0 | 4,639 | 0 | -24 | 155 |
a835c080783b9745efa7ccf09b32743b7fe555dc | 1,827 | py | Python | make_sitemap.py | nikicoon/www_shared | e9508c24b31a60f52578646ec3a47805c787f978 | [
"0BSD"
] | null | null | null | make_sitemap.py | nikicoon/www_shared | e9508c24b31a60f52578646ec3a47805c787f978 | [
"0BSD"
] | null | null | null | make_sitemap.py | nikicoon/www_shared | e9508c24b31a60f52578646ec3a47805c787f978 | [
"0BSD"
] | null | null | null | # Copyright (C) 2019 GNUnet e.V.
#
# This code is derived from code contributed to GNUnet e.V.
# by Nikita Ronja <nikita@NetBSD.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS... | 35.134615 | 143 | 0.660646 | # Copyright (C) 2019 GNUnet e.V.
#
# This code is derived from code contributed to GNUnet e.V.
# by Nikita Ronja <nikita@NetBSD.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS... | 0 | 0 | 0 | 0 | 0 | 875 | 0 | 0 | 90 |
d787b14f9736012c868dbb0f65da3eee4fd67c18 | 1,793 | py | Python | test/test_object_ezsigntemplate_api.py | ezmaxinc/eZmax-SDK-python | 6794b8001abfb7d9ae18a3b87aba164839b925a0 | [
"MIT"
] | null | null | null | test/test_object_ezsigntemplate_api.py | ezmaxinc/eZmax-SDK-python | 6794b8001abfb7d9ae18a3b87aba164839b925a0 | [
"MIT"
] | null | null | null | test/test_object_ezsigntemplate_api.py | ezmaxinc/eZmax-SDK-python | 6794b8001abfb7d9ae18a3b87aba164839b925a0 | [
"MIT"
] | null | null | null | """
eZmax API Definition (Full)
This API expose all the functionnalities for the eZmax and eZsign applications. # noqa: E501
The version of the OpenAPI document: 1.1.7
Contact: support-api@ezmax.ca
Generated by: https://openapi-generator.tech
"""
import unittest
if __name__ == '__main__':
... | 24.902778 | 97 | 0.677078 | """
eZmax API Definition (Full)
This API expose all the functionnalities for the eZmax and eZsign applications. # noqa: E501
The version of the OpenAPI document: 1.1.7
Contact: support-api@ezmax.ca
Generated by: https://openapi-generator.tech
"""
import unittest
import eZmaxApi
from eZmaxApi.a... | 0 | 0 | 0 | 1,326 | 0 | 0 | 0 | 47 | 82 |
6c8d63295e38677fda751c87c4b9bf6690a83b24 | 5,933 | py | Python | examples/pubcrawl/pubcrawl.py | vishalbelsare/soil | e860bdb922a22da2987fba07dffb81351c0272e5 | [
"Apache-2.0"
] | null | null | null | examples/pubcrawl/pubcrawl.py | vishalbelsare/soil | e860bdb922a22da2987fba07dffb81351c0272e5 | [
"Apache-2.0"
] | null | null | null | examples/pubcrawl/pubcrawl.py | vishalbelsare/soil | e860bdb922a22da2987fba07dffb81351c0272e5 | [
"Apache-2.0"
] | null | null | null |
if __name__ == '__main__':
from soil import simulation
simulation.run_from_config('pubcrawl.yml',
dry_run=True,
dump=None,
parallel=False)
| 33.710227 | 89 | 0.549132 | from soil.agents import FSM, state, default_state
from soil import Environment
from random import random, shuffle
from itertools import islice
import logging
class CityPubs(Environment):
'''Environment with Pubs'''
level = logging.INFO
def __init__(self, *args, number_of_pubs=3, pub_capacity=10, **kwargs... | 0 | 1,973 | 0 | 3,488 | 0 | 0 | 0 | 48 | 179 |
22bd22625e9f3124aab03e87e4d2b826649e6a71 | 17,216 | py | Python | rdp.py | Tripwire-VERT/Protocol-Independent-Fuzzer | 0389e41940c8e5615f4ab6097f14d2527fdb01b7 | [
"BSD-2-Clause"
] | 8 | 2015-10-13T08:47:39.000Z | 2022-02-09T04:50:55.000Z | rdp.py | Tripwire-VERT/Protocol-Independent-Fuzzer | 0389e41940c8e5615f4ab6097f14d2527fdb01b7 | [
"BSD-2-Clause"
] | null | null | null | rdp.py | Tripwire-VERT/Protocol-Independent-Fuzzer | 0389e41940c8e5615f4ab6097f14d2527fdb01b7 | [
"BSD-2-Clause"
] | 8 | 2015-02-23T21:09:13.000Z | 2021-04-22T12:23:55.000Z |
#encryption types
FOURTY_BIT = 1
ONE_TWENTY_EIGHT_BIT = 2
FIFTY_SIX_BIT = 8
FIPS = 16
#protocols
DEFAULT = 0
TLS = 1
CredSSP = 2
#other
COTP_DATA = '\x02\xf0\x80'
# added to convert to hex and convert hex strings to ints
| 45.424802 | 232 | 0.600139 | import struct
from Crypto.PublicKey import RSA
import binascii
import rdp_session_key
import rdp_error
#encryption types
FOURTY_BIT = 1
ONE_TWENTY_EIGHT_BIT = 2
FIFTY_SIX_BIT = 8
FIPS = 16
#protocols
DEFAULT = 0
TLS = 1
CredSSP = 2
#other
COTP_DATA = '\x02\xf0\x80'
class RDP( o... | 0 | 0 | 0 | 16,655 | 0 | 101 | 0 | -7 | 202 |
a0d50efa89388ef617d552588363a66db3d35cad | 1,325 | py | Python | my_intrusion_convertor.py | QianruZhou333/ArtificialImmuneSystem | e4c12b784ce76bd01f98eee9ad0949482cbce80a | [
"Apache-2.0"
] | null | null | null | my_intrusion_convertor.py | QianruZhou333/ArtificialImmuneSystem | e4c12b784ce76bd01f98eee9ad0949482cbce80a | [
"Apache-2.0"
] | null | null | null | my_intrusion_convertor.py | QianruZhou333/ArtificialImmuneSystem | e4c12b784ce76bd01f98eee9ad0949482cbce80a | [
"Apache-2.0"
] | null | null | null | # Author: Qianru Zhou
# Email: zhouqr333@126.com
# Magic, do not touch!!
import csv
def intrusionCSV_to_binary(csvDir, binaryDir):
""" Convert the intrusion data in 'intrusion.csv' to binary strings
Args:
csvDir: the absolute directory of the csv file
binaryDir: the absolute directory of the binary file
"""
t... | 25 | 86 | 0.66566 | # Author: Qianru Zhou
# Email: zhouqr333@126.com
# Magic, do not touch!!
import csv
def intrusionCSV_to_binary(csvDir, binaryDir):
""" Convert the intrusion data in 'intrusion.csv' to binary strings
Args:
csvDir: the absolute directory of the csv file
binaryDir: the absolute directory of the binary file
"""
t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
489cd512e5e6d407b6980688e7fcefbf70c58397 | 7,883 | py | Python | bigbench/benchmark_tasks/sudoku/test.py | mswedrowski/BIG-bench | 0927d64905b26f08f851d408f7bb2d7bf1a0e4fa | [
"Apache-2.0"
] | null | null | null | bigbench/benchmark_tasks/sudoku/test.py | mswedrowski/BIG-bench | 0927d64905b26f08f851d408f7bb2d7bf1a0e4fa | [
"Apache-2.0"
] | null | null | null | bigbench/benchmark_tasks/sudoku/test.py | mswedrowski/BIG-bench | 0927d64905b26f08f851d408f7bb2d7bf1a0e4fa | [
"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, so... | 33.544681 | 104 | 0.669796 | # 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, so... | 0 | 0 | 0 | 2,260 | 0 | 3,590 | 0 | 70 | 526 |
e524bd1d4fc69985d839a2a43b050e3316cdf066 | 2,863 | py | Python | scripts/install.py | JajMandu96/TheDuckpvpProject | dadd21dd9fe0dd06d07f1acd46702da25905bb5b | [
"Apache-2.0"
] | null | null | null | scripts/install.py | JajMandu96/TheDuckpvpProject | dadd21dd9fe0dd06d07f1acd46702da25905bb5b | [
"Apache-2.0"
] | null | null | null | scripts/install.py | JajMandu96/TheDuckpvpProject | dadd21dd9fe0dd06d07f1acd46702da25905bb5b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
if not os.geteuid() == 0:
sys.exit("""\033[1;91m\n[!] Xerosploit installer must be run as root.\n\033[1;m""")
print(""" \033[1;36m
\033[1;m""")
main()
| 53.018519 | 462 | 0.494586 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
if not os.geteuid() == 0:
sys.exit("""\033[1;91m\n[!] Xerosploit installer must be run as root.\n\033[1;m""")
print(""" \033[1;36m
██████╗░██╗░░░██╗░█████╗░██╗░░██╗██████╗░██╗░░░██╗██████╗░
██╔══██╗██║░░░██║██╔══██╗██║░██╔╝██╔══██╗██║░░░██║██╔══██╗
█... | 2,286 | 0 | 0 | 0 | 0 | 1,840 | 0 | 0 | 23 |
f9c503779b42667f8b1780088a96205e2ab21c18 | 1,405 | py | Python | ntwrk/bayesopt/utils.py | g-benton/PCC-RL | 56c9d7cbe4cca0a24bb136dcadb46dface1c0ad0 | [
"Apache-2.0"
] | null | null | null | ntwrk/bayesopt/utils.py | g-benton/PCC-RL | 56c9d7cbe4cca0a24bb136dcadb46dface1c0ad0 | [
"Apache-2.0"
] | null | null | null | ntwrk/bayesopt/utils.py | g-benton/PCC-RL | 56c9d7cbe4cca0a24bb136dcadb46dface1c0ad0 | [
"Apache-2.0"
] | null | null | null |
def compute_reward(monitor_interval):
"""
Get an Estimate of the throughput of the network
using on the last few packets (the lag)
"""
loss = len(monitor_interval.ack)/len(monitor_interval.sent)
latency = sum(monitor_interval.rtts)/len(monitor_interval.rtts)
###############################... | 28.1 | 67 | 0.594306 | import math
import torch
def compute_reward(monitor_interval):
"""
Get an Estimate of the throughput of the network
using on the last few packets (the lag)
"""
loss = len(monitor_interval.ack)/len(monitor_interval.sent)
latency = sum(monitor_interval.rtts)/len(monitor_interval.rtts)
######... | 0 | 0 | 0 | 920 | 0 | 0 | 0 | -19 | 90 |
367eaeabc2bdeca79e6f3ede74eb2ec1e1fa34c9 | 9,932 | py | Python | app/blobsentiment.py | mcpeixoto/Sentrade | 55f65508d6b565b99840c9ce5d757185f5027164 | [
"MIT"
] | 4 | 2020-09-28T18:40:47.000Z | 2021-12-01T08:29:29.000Z | app/blobsentiment.py | ZiyouZhang/Sentrade | c88d20a858de6d05649f99230ca2b44f4c76cd3c | [
"MIT"
] | null | null | null | app/blobsentiment.py | ZiyouZhang/Sentrade | c88d20a858de6d05649f99230ca2b44f4c76cd3c | [
"MIT"
] | 2 | 2021-08-10T22:32:52.000Z | 2022-02-03T21:28:47.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Davide Locatelli, Ziyou Zhang"
__status__ = "Production"
import json
import sys
import spacy
import os
from datetime import datetime, timedelta
from textblob import TextBlob
from pymongo import MongoClient
from pymongo import errors
def get_date_offset(dat... | 41.556485 | 127 | 0.657571 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Davide Locatelli, Ziyou Zhang"
__status__ = "Production"
import json
import sys
import spacy
import os
from datetime import datetime, timedelta
from dateutil.parser import parse
from textblob import TextBlob
from pymongo import MongoClient
from pymongo impo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 22 |
aa58e4dc56908c61558deac2af846a500cab22a8 | 9,172 | py | Python | src/clusto/drivers/devices/common/portmixin.py | thekad/clusto | c141ea3ef4931c6a21fdf42845c6e9de5ee08caa | [
"BSD-3-Clause"
] | 216 | 2015-01-10T17:03:25.000Z | 2022-03-24T07:23:41.000Z | src/clusto/drivers/devices/common/portmixin.py | thekad/clusto | c141ea3ef4931c6a21fdf42845c6e9de5ee08caa | [
"BSD-3-Clause"
] | 23 | 2015-01-08T16:51:22.000Z | 2021-03-13T12:56:04.000Z | src/clusto/drivers/devices/common/portmixin.py | thekad/clusto | c141ea3ef4931c6a21fdf42845c6e9de5ee08caa | [
"BSD-3-Clause"
] | 49 | 2015-01-08T00:13:17.000Z | 2021-09-22T02:01:20.000Z | """
PortMixin is a basic mixin to be used with devices that have ports
"""
| 32.992806 | 102 | 0.561055 | """
PortMixin is a basic mixin to be used with devices that have ports
"""
import clusto
from clusto.exceptions import ConnectionException
class PortMixin:
"""Provide port capabilities to devices
The ports are defined in the Driver's _portmeta dictionary:
_portmeta = { '<porttype>' : {'numports':... | 0 | 1,633 | 0 | 7,371 | 0 | 0 | 0 | 20 | 69 |
989caf958e039af9c96b04408dd71b0df1e3f2a9 | 18,361 | py | Python | raspi/ledStripController.py | jimenezl/web-controlled-led-strips | d920d2ce5d92c4b79d2580b1877ff129407ba783 | [
"MIT"
] | null | null | null | raspi/ledStripController.py | jimenezl/web-controlled-led-strips | d920d2ce5d92c4b79d2580b1877ff129407ba783 | [
"MIT"
] | null | null | null | raspi/ledStripController.py | jimenezl/web-controlled-led-strips | d920d2ce5d92c4b79d2580b1877ff129407ba783 | [
"MIT"
] | null | null | null | #!/usr/bin/python
##import RPi.GPIO as GPIO
#import requests
controller = ledStripController()
controller.runMainLoop()
| 35.652427 | 220 | 0.559991 | #!/usr/bin/python
import time
##import RPi.GPIO as GPIO
#import requests
import os
import random
import pigpio
class ledStripController(object):
def __init__(self):
"""
Object for controlling LED Strips
"""
self.RED_PIN = 9 #Change me to the pin hooked up to red
self.GREEN_... | 0 | 0 | 0 | 18,163 | 0 | 0 | 0 | -38 | 111 |
f6b44857d69b1e871cf3b6c1f0dd6f76bcf874d0 | 2,349 | py | Python | filmrolls2exif.py | Apreche/filmrolls2exif | 78f8b24d96067dbc0b7256182d236638be5d79c5 | [
"MIT"
] | null | null | null | filmrolls2exif.py | Apreche/filmrolls2exif | 78f8b24d96067dbc0b7256182d236638be5d79c5 | [
"MIT"
] | null | null | null | filmrolls2exif.py | Apreche/filmrolls2exif | 78f8b24d96067dbc0b7256182d236638be5d79c5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
ROLL_FIELDS = [
'title',
'speed',
'camera',
'load',
'unload',
'note',
]
FRAME_FIELDS = [
'lens',
'aperture',
'shutterSpeed',
'compensation',
'accessory',
'number',
'date',
'latitude',
'longitude',
'note',
]
if __name__ == "__main_... | 25.258065 | 83 | 0.614304 | #!/usr/bin/env python
import exif
import os
import re
from xml.etree import ElementTree
ROLL_FIELDS = [
'title',
'speed',
'camera',
'load',
'unload',
'note',
]
FRAME_FIELDS = [
'lens',
'aperture',
'shutterSpeed',
'compensation',
'accessory',
'number',
'date',
... | 0 | 0 | 0 | 0 | 0 | 1,808 | 0 | -22 | 228 |
cd133d1ded6c055658833bb30ef3b487879dffd0 | 776 | py | Python | runehistory_api/framework/api/v1/controllers/stats.py | RuneHistory/runehistory-api | 4e857c7fdbdf585d57cf4c7fe6214b565ac37a22 | [
"MIT"
] | null | null | null | runehistory_api/framework/api/v1/controllers/stats.py | RuneHistory/runehistory-api | 4e857c7fdbdf585d57cf4c7fe6214b565ac37a22 | [
"MIT"
] | 6 | 2018-06-14T13:58:43.000Z | 2018-07-16T14:02:24.000Z | runehistory_api/framework/api/v1/controllers/stats.py | RuneHistory/runehistory-api | 4e857c7fdbdf585d57cf4c7fe6214b565ac37a22 | [
"MIT"
] | null | null | null | from flask import Blueprint
stats_bp = Blueprint('stats', __name__)
| 26.758621 | 76 | 0.748711 | from flask import Blueprint, jsonify, Response
from cmdbus import cmdbus
from runehistory_api.app.commands.stats import GetAccountCountCommand, \
GetHighScoreCountCommand
from runehistory_api.framework.auth import requires_jwt, requires_permission
stats_bp = Blueprint('stats', __name__)
@stats_bp.route('/accoun... | 0 | 434 | 0 | 0 | 0 | 0 | 0 | 158 | 113 |
70135212e5a504fe182af186aeb24f41b5b15f98 | 425 | py | Python | rubberband/utils/file.py | ambros-gleixner/rubberband | 72dd935dbc4bed93860fdcaa0cbe752bcbd6e395 | [
"MIT"
] | 4 | 2018-03-25T15:01:20.000Z | 2020-06-22T14:34:01.000Z | rubberband/utils/file.py | ambros-gleixner/rubberband | 72dd935dbc4bed93860fdcaa0cbe752bcbd6e395 | [
"MIT"
] | 41 | 2016-12-19T21:17:41.000Z | 2021-12-13T19:50:34.000Z | rubberband/utils/file.py | ambros-gleixner/rubberband | 72dd935dbc4bed93860fdcaa0cbe752bcbd6e395 | [
"MIT"
] | 1 | 2017-10-06T13:52:57.000Z | 2017-10-06T13:52:57.000Z | """Methods to help with file io."""
from rubberband.constants import FILES_DIR
def write_file(filename, contents):
"""
Save a file on the filesystem.
Parameters
----------
filename : string
Filename of file to write to.
contents : string
Contents to write into file.
"""
... | 20.238095 | 42 | 0.611765 | """Methods to help with file io."""
from rubberband.constants import FILES_DIR
def write_file(filename, contents):
"""
Save a file on the filesystem.
Parameters
----------
filename : string
Filename of file to write to.
contents : string
Contents to write into file.
"""
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
95297ac0803182de62e995e2c17970b4a3eab2fc | 349 | py | Python | info.py | Tomtomgo/bingpy3 | e7ac6d873df70e5a0da01832d29d2564e753f671 | [
"MIT"
] | null | null | null | info.py | Tomtomgo/bingpy3 | e7ac6d873df70e5a0da01832d29d2564e753f671 | [
"MIT"
] | null | null | null | info.py | Tomtomgo/bingpy3 | e7ac6d873df70e5a0da01832d29d2564e753f671 | [
"MIT"
] | null | null | null | # package information.
INFO = dict(
name = "bingpy3",
description = "Python 3 Bing Search API (2015)",
author = "Makoto P. Kato",
author_email = "kato@dl.kuis.kyoto-u.ac.jp",
license = "MIT License",
url = "https://github.com/tomtomgo/bingpy3",
classifiers = [
"Programming Lang... | 26.846154 | 54 | 0.595989 | # package information.
INFO = dict(
name = "bingpy3",
description = "Python 3 Bing Search API (2015)",
author = "Makoto P. Kato",
author_email = "kato@dl.kuis.kyoto-u.ac.jp",
license = "MIT License",
url = "https://github.com/tomtomgo/bingpy3",
classifiers = [
"Programming Lang... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e17df3ceeee399b2576844edfafc1165afe2cbc0 | 692 | py | Python | setup.py | tarekziade/utproxy | bc77a9d81c25e4b292ba71ef995f89f667ba68f5 | [
"Apache-2.0"
] | 8 | 2019-06-29T00:30:48.000Z | 2022-03-25T15:46:39.000Z | setup.py | tarekziade/utproxy | bc77a9d81c25e4b292ba71ef995f89f667ba68f5 | [
"Apache-2.0"
] | 15 | 2019-07-01T08:21:46.000Z | 2019-12-02T15:18:37.000Z | setup.py | tarekziade/utproxy | bc77a9d81c25e4b292ba71ef995f89f667ba68f5 | [
"Apache-2.0"
] | null | null | null | # encoding: utf8
import sys
from setuptools import setup, find_packages
with open("README.rst") as f:
README = f.read()
if sys.platform == "win32":
install_requires = ["pywin32"]
else:
install_requires = []
setup(name="tinap",
version="0.3",
author="Tarek Ziad",
author_email="tarek@mo... | 22.322581 | 57 | 0.654624 | # encoding: utf8
import os
import sys
from setuptools import setup, find_packages
with open("README.rst") as f:
README = f.read()
if sys.platform == "win32":
install_requires = ["pywin32"]
else:
install_requires = []
setup(name="tinap",
version="0.3",
author="Tarek Ziadé",
author_emai... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
3d463dbebb7fd4d70ed818d30349a58fe682c95e | 2,302 | py | Python | orderable/tests/run.py | codingjoe/django-orderable | 4e4102aafdfb246f12443cb1d36aecbccca9f2fe | [
"BSD-2-Clause"
] | null | null | null | orderable/tests/run.py | codingjoe/django-orderable | 4e4102aafdfb246f12443cb1d36aecbccca9f2fe | [
"BSD-2-Clause"
] | null | null | null | orderable/tests/run.py | codingjoe/django-orderable | 4e4102aafdfb246f12443cb1d36aecbccca9f2fe | [
"BSD-2-Clause"
] | null | null | null | import sys
from argparse import ArgumentParser
import django
from django.conf import settings
settings.configure(
DATABASES={'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'orderable',
'HOST': 'localhost'
}},
INSTALLED_APPS=(
'orderable.tests',
... | 32.885714 | 80 | 0.651173 | import sys
from argparse import ArgumentParser
import django
from django.conf import settings
settings.configure(
DATABASES={'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'orderable',
'HOST': 'localhost'
}},
INSTALLED_APPS=(
'orderable.tests',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e6ce57cd0fc03cdfa5fd18b861fe0f8f5536e5fc | 177 | py | Python | mil_nets/__init__.py | dipanshawucr/DeepLPI | b6bfe44fd49102090f4b255d53912c804548da69 | [
"MIT"
] | 1 | 2021-06-05T17:39:30.000Z | 2021-06-05T17:39:30.000Z | mil_nets/__init__.py | dipanshawucr/DeepLPI | b6bfe44fd49102090f4b255d53912c804548da69 | [
"MIT"
] | null | null | null | mil_nets/__init__.py | dipanshawucr/DeepLPI | b6bfe44fd49102090f4b255d53912c804548da69 | [
"MIT"
] | 2 | 2020-04-11T20:02:44.000Z | 2021-11-23T04:51:37.000Z | from __future__ import absolute_import
| 22.125 | 38 | 0.80791 | from __future__ import absolute_import
from . import metrics
from . import objectives
from . import dataset
from . import utils
from . import layer
from . import pooling_method
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 132 |
09906744a1789b9bd42ff68225cd26c2d855e0fb | 9,311 | py | Python | header.py | sradiouy/DARK | 7c78c362803175c8257dd567518c2b6eb917cd39 | [
"MIT"
] | null | null | null | header.py | sradiouy/DARK | 7c78c362803175c8257dd567518c2b6eb917cd39 | [
"MIT"
] | 4 | 2021-03-19T02:58:22.000Z | 2022-03-11T23:58:11.000Z | header.py | sradiouy/DARK | 7c78c362803175c8257dd567518c2b6eb917cd39 | [
"MIT"
] | null | null | null | # coding=utf-8
import dash_core_components as dcc
import dash_html_components as html
logo = "https://raw.githubusercontent.com/sradiouy/DARK/master/Images/Capa%200.png"
# row1
header = html.Div([
html.Img(className="logo",src=logo),
], className='navbar navbar-default navbar-static-top',style={"... | 49.791444 | 144 | 0.511975 | # coding=utf-8
import dash
import dash_table
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import pandas as pd
logo = "https://raw.githubusercontent.com/sradiouy/DARK/master/Images/Capa%200.pn... | 30 | 0 | 0 | 0 | 0 | 0 | 0 | 31 | 115 |
81305e071ad90fb8ca67b64d8de51a6e68234a4c | 9,698 | py | Python | doc/source/ext/snapshotqt_directive.py | tacaswell/silx | 67f0ac8d3fcb5764c23b2210becfe2052f98061d | [
"CC0-1.0",
"MIT"
] | null | null | null | doc/source/ext/snapshotqt_directive.py | tacaswell/silx | 67f0ac8d3fcb5764c23b2210becfe2052f98061d | [
"CC0-1.0",
"MIT"
] | null | null | null | doc/source/ext/snapshotqt_directive.py | tacaswell/silx | 67f0ac8d3fcb5764c23b2210becfe2052f98061d | [
"CC0-1.0",
"MIT"
] | 1 | 2017-04-02T18:00:14.000Z | 2017-04-02T18:00:14.000Z | # coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2004-2019 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... | 39.909465 | 100 | 0.579295 | # coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2004-2019 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... | 0 | 0 | 0 | 4,011 | 0 | 2,993 | 0 | 48 | 253 |
7420ed782cf8e19fa74f0f760b4798848f31896a | 1,432 | py | Python | active-speaker-detection/wearer/energy_based/match_wearer_audio.py | EGO4D/audio-visual | bed9d837f4212e89540fe73f54399f69739b73f5 | [
"MIT"
] | 15 | 2021-12-06T14:13:23.000Z | 2022-03-14T02:02:53.000Z | active-speaker-detection/wearer/energy_based/match_wearer_audio.py | EGO4D/audio-visual | bed9d837f4212e89540fe73f54399f69739b73f5 | [
"MIT"
] | null | null | null | active-speaker-detection/wearer/energy_based/match_wearer_audio.py | EGO4D/audio-visual | bed9d837f4212e89540fe73f54399f69739b73f5 | [
"MIT"
] | 3 | 2021-11-25T19:10:21.000Z | 2022-03-11T12:10:41.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Usage: python3 match_wearer_audio.py data_set
import pickle
import sys
import os
import numpy as np
from scipy.spatial.distance import cdist
data_set = sys.argv[1] # 'test' or 'val'
if not os.path.isfile(data_set + '.txt'):
sys.exit(data_set + ' list does not exist... | 29.833333 | 112 | 0.598464 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Usage: python3 match_wearer_audio.py data_set
import pickle
import sys
import os
import numpy as np
from scipy.spatial.distance import cdist
data_set = sys.argv[1] # 'test' or 'val'
if not os.path.isfile(data_set + '.txt'):
sys.exit(data_set + ' list does not exist... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4df144d75dd397c47811fb8f1e7a666984506e79 | 123 | py | Python | tests/test-cases/typeinfer_basecase/case2.py | SMAT-Lab/Scalpel | 1022200043f2d9e8c24256821b863997ab34dd49 | [
"Apache-2.0"
] | 102 | 2021-12-15T09:08:48.000Z | 2022-03-24T15:15:25.000Z | tests/test-cases/typeinfer_basecase/case2.py | StarWatch27/Scalpel | 8853e6e84f318f3cfeda0e03d274748b2fbe30fa | [
"Apache-2.0"
] | 11 | 2021-12-04T11:48:31.000Z | 2022-03-21T09:21:45.000Z | tests/test-cases/typeinfer_basecase/case2.py | StarWatch27/Scalpel | 8853e6e84f318f3cfeda0e03d274748b2fbe30fa | [
"Apache-2.0"
] | 11 | 2021-12-04T11:47:41.000Z | 2022-02-06T09:04:39.000Z | # Constant return type
# EXPECTED OUTPUT:
# case2.py: my_function() -> str
| 13.666667 | 32 | 0.674797 | # Constant return type
# EXPECTED OUTPUT:
# case2.py: my_function() -> str
def my_function():
return "Hello world!"
| 0 | 0 | 0 | 0 | 0 | 23 | 0 | 0 | 23 |
13f01c8d88f375315f15aa6f7654f9b960c7cc2d | 13,619 | py | Python | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/google/gcp_compute_disk_facts.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2019-04-16T21:23:15.000Z | 2019-04-16T21:23:15.000Z | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/google/gcp_compute_disk_facts.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 5 | 2020-02-26T20:10:50.000Z | 2021-09-23T23:23:18.000Z | ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/google/gcp_compute_disk_facts.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | 40.532738 | 139 | 0.551215 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | 0 | 0 | 0 | 0 | 0 | 1,805 | 0 | 60 | 159 |
757a960db966a572538098b07bb37f9cd69fc62d | 770 | py | Python | link_product_alias/link_product_alias.py | dhightnm/pyScripts | 7855e204ab365398a4f2363494fd09174ba75228 | [
"MIT"
] | null | null | null | link_product_alias/link_product_alias.py | dhightnm/pyScripts | 7855e204ab365398a4f2363494fd09174ba75228 | [
"MIT"
] | null | null | null | link_product_alias/link_product_alias.py | dhightnm/pyScripts | 7855e204ab365398a4f2363494fd09174ba75228 | [
"MIT"
] | null | null | null | import json
url = "{{productUrl}}/v1/product/replace_me"
f = open('./output_file_name.json')
json_data_packet = json.load(f)
print(link_alias(json_data_packet))
| 25.666667 | 75 | 0.683117 | import requests
import json, csv
url = "{{productUrl}}/v1/product/replace_me"
f = open('./output_file_name.json')
json_data_packet = json.load(f)
def link_alias(json_data):
for object in json_data:
url = "https://product.deliverr.com/v1/product-alias/link"
payload = json.dumps({
"channelId": "Sell... | 0 | 0 | 0 | 0 | 0 | 561 | 0 | -1 | 45 |
14c7ea82e8f601691d9d642ee6de23e471f461ab | 6,521 | py | Python | nimbus/config.py | usdhs/nimbus | 8d53510081c42cb585ebf6b6a3bcff72a33a8bf9 | [
"CC0-1.0"
] | null | null | null | nimbus/config.py | usdhs/nimbus | 8d53510081c42cb585ebf6b6a3bcff72a33a8bf9 | [
"CC0-1.0"
] | 1 | 2017-12-21T19:34:59.000Z | 2017-12-21T19:34:59.000Z | nimbus/config.py | usdhs/nimbus | 8d53510081c42cb585ebf6b6a3bcff72a33a8bf9 | [
"CC0-1.0"
] | 1 | 2022-03-29T15:32:27.000Z | 2022-03-29T15:32:27.000Z | """
Configuration functions
"""
import os
# TODO: is this correct for Windows?
DEFAULT_CONFIG_DIR = os.path.join(os.path.expanduser('~'), '.aws', 'nimbus')
| 31.350962 | 79 | 0.597148 | """
Configuration functions
"""
import os
import subprocess
from collections import namedtuple
from functools import wraps
import atomicwrites
import requests
import yaml
from .errors import NotFound, ManyFound
from .logs import log
from .utils import merged_dicts, mkdir_p
# TODO: is this correct for Windows?
DEFAU... | 0 | 0 | 0 | 6,105 | 0 | 0 | 0 | 34 | 223 |
63e1979752ad523a45f0ef39d5ad4cf18d316115 | 11,186 | py | Python | doc/build/patched_autosummary.py | drewrisinger/pyGSTi | dd4ad669931c7f75e026456470cf33ac5b682d0d | [
"Apache-2.0"
] | 1 | 2021-12-19T15:11:09.000Z | 2021-12-19T15:11:09.000Z | doc/build/patched_autosummary.py | drewrisinger/pyGSTi | dd4ad669931c7f75e026456470cf33ac5b682d0d | [
"Apache-2.0"
] | null | null | null | doc/build/patched_autosummary.py | drewrisinger/pyGSTi | dd4ad669931c7f75e026456470cf33ac5b682d0d | [
"Apache-2.0"
] | null | null | null | """
This file contains a *slightly* (see single "OLD" changed line) version of
the `generate_autosummary_docs` function found in
.../site_packages/sphinx/ext/autosummary/generate.py, which determines how
to process the .. autosummary:: directives in pyGSTi's documentation-
generating .rst files.
In pyGSTi, s... | 44.03937 | 140 | 0.582424 | """
This file contains a *slightly* (see single "OLD" changed line) version of
the `generate_autosummary_docs` function found in
.../site_packages/sphinx/ext/autosummary/generate.py, which determines how
to process the .. autosummary:: directives in pyGSTi's documentation-
generating .rst files.
In pyGSTi, s... | 0 | 0 | 0 | 0 | 1,223 | 7,653 | 0 | 117 | 188 |
2d30e22f6cefe02f33eb72de6b99e9259850883b | 27,387 | py | Python | main.py | rdbende/WhirlEdit | 248c36bfe01c7bb38f95973f4a761d1d184cc720 | [
"MIT"
] | null | null | null | main.py | rdbende/WhirlEdit | 248c36bfe01c7bb38f95973f4a761d1d184cc720 | [
"MIT"
] | null | null | null | main.py | rdbende/WhirlEdit | 248c36bfe01c7bb38f95973f4a761d1d184cc720 | [
"MIT"
] | null | null | null | import os
import yaml
import tkinter as tk
from tkinter import ttk
import shutil
import tkinter
import zipfile
import tempfile
import webbrowser
try:
configuration = (yaml.safe_load(open('configure.yaml').read()))
except:
configuration = (yaml.safe_load(defaults.configuration))
openedfolders = []
hi... | 37.671252 | 1,588 | 0.61259 | import os
import yaml
import tkinter as tk
from tkinter import ttk
from tkinter import *
import tkinter.font as tkfont
from tkinter.filedialog import askopenfilename, asksaveasfilename
import subprocess
import shutil
import tkinter
import zipfile
import tempfile
from wday import *
from tkcode import CodeEd... | 0 | 0 | 0 | 5,959 | 0 | 11,649 | 0 | 105 | 932 |
481b78ded2e2793a0661fb5abdf745246a317a74 | 46,084 | py | Python | plaso/proto/plaso_storage_pb2.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | 2 | 2016-02-18T12:46:29.000Z | 2022-03-13T03:04:59.000Z | plaso/proto/plaso_storage_pb2.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | null | null | null | plaso/proto/plaso_storage_pb2.py | Defense-Cyber-Crime-Center/plaso | 4f3a85fbea10637c1cdbf0cde9fc539fdcea9c47 | [
"Apache-2.0"
] | 6 | 2016-12-18T08:05:36.000Z | 2021-04-06T14:19:11.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='plaso/proto/plaso_storage.proto',
package='plaso_storage',
serialized_pb='\n\x1fplaso/proto/plaso_storage.proto\x12\rplaso_storage... | 44.226488 | 4,916 | 0.726933 | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='plaso/proto/plas... | 0 | 0 | 0 | 1,933 | 0 | 0 | 0 | 52 | 273 |
f102fe1a5ce4bbe60d24f984094cde7d41be5721 | 1,059 | py | Python | chapter101/postgres_elasticsearch.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | chapter101/postgres_elasticsearch.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | chapter101/postgres_elasticsearch.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | import psycopg
import psycopg.extras
from datetime import datetime
from elasticsearch import helpers, Elasticsearch
start = datetime.now()
postgres_client = psycopg.connect("postgres://username:password@127.0.0.1")
elasticsearch_client = Elasticsearch("http://username:password@127.0.0.1:9200")
cursor = postgres_clie... | 23.021739 | 79 | 0.733711 | import psycopg
import elasticsearch
import psycopg.extras
from datetime import datetime
from elasticsearch import helpers, Elasticsearch
start = datetime.now()
postgres_client = psycopg.connect("postgres://username:password@127.0.0.1")
elasticsearch_client = Elasticsearch("http://username:password@127.0.0.1:9200")
c... | 0 | 0 | 0 | 0 | 0 | 74 | 0 | -1 | 45 |
9d212419983afbfcebd8cc8c0bb3e35220f6c9af | 1,206 | py | Python | obtain_kmeans_clusters_using_embeddings.py | francescoferretto/Investigating-relationships-between-Twitter-latent-topics-and-political-orientation | c6f1ff05ac8960885f26a153d7c0c8ecf1364a6a | [
"MIT"
] | null | null | null | obtain_kmeans_clusters_using_embeddings.py | francescoferretto/Investigating-relationships-between-Twitter-latent-topics-and-political-orientation | c6f1ff05ac8960885f26a153d7c0c8ecf1364a6a | [
"MIT"
] | null | null | null | obtain_kmeans_clusters_using_embeddings.py | francescoferretto/Investigating-relationships-between-Twitter-latent-topics-and-political-orientation | c6f1ff05ac8960885f26a153d7c0c8ecf1364a6a | [
"MIT"
] | null | null | null | import pandas as pd
import logging
import sys
#
# Configure the path
#FILE_PATH = Path(__file__).resolve().parent
FILE_PATH = '/home/emi/unipd/Sartori_CBSD/project/cbsdproject'
DATA_PATH = FILE_PATH + '/data'
DATA_FILE = DATA_PATH + '/tweets_cleaned.csv'
UTILS_PATH = FILE_PATH + '/utils'
MODELS_PATH = FILE_PATH + '/m... | 26.217391 | 125 | 0.801824 | import pandas as pd
import os
import logging
from pathlib import Path
import sys
#
# Configure the path
#FILE_PATH = Path(__file__).resolve().parent
FILE_PATH = '/home/emi/unipd/Sartori_CBSD/project/cbsdproject'
DATA_PATH = FILE_PATH + '/data'
DATA_FILE = DATA_PATH + '/tweets_cleaned.csv'
UTILS_PATH = FILE_PATH + '/u... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -9 | 44 |
0ce84069af4a81a6afa650fb724bf3bc8a25f2f4 | 2,162 | py | Python | scripts/filter_csv.py | sunlightlabs/hall-of-justice | 8c2ce47f792e0182c84d13dca808564a6ac376b4 | [
"BSD-3-Clause"
] | 7 | 2015-05-08T03:48:54.000Z | 2016-02-04T01:01:51.000Z | scripts/filter_csv.py | themarshallproject/hall-of-justice | 8c2ce47f792e0182c84d13dca808564a6ac376b4 | [
"BSD-3-Clause"
] | 44 | 2015-03-20T17:16:58.000Z | 2016-04-27T20:17:29.000Z | scripts/filter_csv.py | sunlightlabs/hall-of-justice | 8c2ce47f792e0182c84d13dca808564a6ac376b4 | [
"BSD-3-Clause"
] | 5 | 2015-06-22T13:49:08.000Z | 2016-01-30T23:19:16.000Z | #!/usr/bin/env python3
import sys
import logging
import argparse
from signal import signal, SIGPIPE, SIG_DFL
logger = logging.getLogger()
signal(SIGPIPE, SIG_DFL)
FILTER_MAP = {
'ufo-states': unidentified_states,
'no-title': no_title,
'no-group': no_group,
'multi-cat': multiple_categories
}
if... | 29.216216 | 111 | 0.649861 | #!/usr/bin/env python3
import os
import sys
import logging
import csv
import argparse
from signal import signal, SIGPIPE, SIG_DFL
logger = logging.getLogger()
signal(SIGPIPE, SIG_DFL)
def unidentified_states(item):
value = item.get('State', None)
return (value is None or (len(value) > 2 and value.strip() !=... | 0 | 0 | 0 | 0 | 0 | 1,043 | 0 | -23 | 160 |
2b0b9acba04f75507fbd34e18fe773e63b51c37a | 4,840 | py | Python | src_para/eval_AHDE.py | david-yoon/detecting-incongruity | 2e121fdba0da3a6a0c63df0c46a101a789fe7565 | [
"MIT"
] | 36 | 2018-11-25T21:43:10.000Z | 2022-03-13T10:47:50.000Z | src_para/eval_AHDE.py | david-yoon/detecting-incongruity | 2e121fdba0da3a6a0c63df0c46a101a789fe7565 | [
"MIT"
] | 1 | 2019-06-16T07:45:47.000Z | 2019-10-14T06:00:29.000Z | src_para/eval_AHDE.py | david-yoon/detecting-incongruity | 2e121fdba0da3a6a0c63df0c46a101a789fe7565 | [
"MIT"
] | 5 | 2018-12-09T06:40:19.000Z | 2019-10-17T22:07:58.000Z | #-*- coding: utf-8 -*-
'''
evaluate AHDE
'''
import argparse
if __name__ == '__main__':
p = argparse.ArgumentParser()
p.add_argument('--model_path', type=str, default="")
p.add_argument('--batch_size', type=int, default=256)
p.add_argument('--encoder_size', type=int, default=8... | 35.588235 | 129 | 0.572934 | #-*- coding: utf-8 -*-
'''
evaluate AHDE
'''
import csv
from AHDE_Model import *
from AHDE_process_data import *
from AHDE_evaluation import *
import os
import time
import argparse
from random import shuffle
from params import Params
def main(model_path, batch_size, encoder_size, context_size, encoderR_size, num_la... | 0 | 0 | 0 | 0 | 0 | 2,501 | 0 | -3 | 202 |
1235b03a76d72c18a9ff87d252bed46daae150d2 | 2,958 | py | Python | app/users.py | Rosk/flasqlite | 425dc71385e156e1339d8aa1b8d0623ec2ce6d16 | [
"MIT"
] | 1 | 2015-01-06T11:33:55.000Z | 2015-01-06T11:33:55.000Z | app/users.py | Rosk/flasqlite | 425dc71385e156e1339d8aa1b8d0623ec2ce6d16 | [
"MIT"
] | null | null | null | app/users.py | Rosk/flasqlite | 425dc71385e156e1339d8aa1b8d0623ec2ce6d16 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Decorators
# ----------------------------------------------------------------------------------------------------------------------
# TODO: Mssen Decorators in jedem .py - File vorkommen - oder kann man die nicht zentral ausgliedern?
def login_erforderlich(f):
"""Der Decorator fragt ab o... | 37.443038 | 135 | 0.605139 | # -*- coding: utf-8 -*-
from app import *
from functools import wraps
from datetime import datetime
# Decorators
# ----------------------------------------------------------------------------------------------------------------------
# TODO: Müssen Decorators in jedem .py - File vorkommen - oder kann man die nicht zen... | 8 | 1,289 | 0 | 0 | 0 | 222 | 0 | 10 | 186 |
513a76d222c9bc88b2bd099fee1ccb01a6f2b44a | 1,000 | py | Python | MAIN_INTERFACE.py | rip3045/VisionSystem | a220b0f1b398ad31c69cb0f28711604511abe0ec | [
"MIT"
] | 6 | 2018-08-04T03:33:53.000Z | 2021-11-14T21:19:49.000Z | MAIN_INTERFACE.py | rip3045/VisionSystem | a220b0f1b398ad31c69cb0f28711604511abe0ec | [
"MIT"
] | null | null | null | MAIN_INTERFACE.py | rip3045/VisionSystem | a220b0f1b398ad31c69cb0f28711604511abe0ec | [
"MIT"
] | null | null | null |
if __name__=="__main__":
main() | 25.641026 | 50 | 0.577 | import image_sectioner
import video_capture
import video_feed_test
import pyueye_main
import video_capture_with_IDS
def main():
user_input = None
while user_input != '0':
user_input = input("""
0 - Quit the program
1 - test video input feed
2 -test video input feed IDS camera
3 -... | 0 | 0 | 0 | 0 | 0 | 816 | 0 | 6 | 140 |
90709a7e93647713a3f8ac6a730fb759244d8f98 | 6,895 | py | Python | graphical.py | atif5/cuschess | e45ed0a2cf38c909dfcd0cddf94003a0a4a71242 | [
"Unlicense"
] | null | null | null | graphical.py | atif5/cuschess | e45ed0a2cf38c909dfcd0cddf94003a0a4a71242 | [
"Unlicense"
] | null | null | null | graphical.py | atif5/cuschess | e45ed0a2cf38c909dfcd0cddf94003a0a4a71242 | [
"Unlicense"
] | null | null | null |
LIGHTPINK = "#FFC0CB"
PINK = "#FF69B4"
RED = "#FF0000"
WHITE = "#FFFFFF"
BLACK = "#000000"
| 37.677596 | 137 | 0.513561 |
from cuschess.logic import *
import pygame
import time
LIGHTPINK = "#FFC0CB"
PINK = "#FF69B4"
RED = "#FF0000"
WHITE = "#FFFFFF"
BLACK = "#000000"
class BoardGraphical:
sprites = {
10: pygame.image.load("cuschess/sprites/wpawn.png"),
11: pygame.image.load("cuschess/sprites/wrook.png"),
1... | 0 | 0 | 0 | 6,722 | 0 | 0 | 0 | -11 | 90 |
21b09862064a159c44da41169183e8e04725c303 | 13,748 | py | Python | 001_madeline.py | bigdatamatta/ChaLearn_Automatic_Machine_Learning_Challenge_2015 | a9acb6906ff141e7c24cff80f92efef7d7c3ff09 | [
"BSD-2-Clause"
] | 1 | 2019-06-12T19:55:35.000Z | 2019-06-12T19:55:35.000Z | 001_madeline.py | bigdatamatta/ChaLearn_Automatic_Machine_Learning_Challenge_2015 | a9acb6906ff141e7c24cff80f92efef7d7c3ff09 | [
"BSD-2-Clause"
] | null | null | null | 001_madeline.py | bigdatamatta/ChaLearn_Automatic_Machine_Learning_Challenge_2015 | a9acb6906ff141e7c24cff80f92efef7d7c3ff09 | [
"BSD-2-Clause"
] | null | null | null | import argparse
import os
import numpy as np
import autosklearn
import autosklearn.data
import autosklearn.data.data_manager
import autosklearn.models.evaluator
from ParamSklearn.classification import ParamSklearnClassifier
parser = argparse.ArgumentParser()
parser.add_argument('input')
parser.add_argument('output'... | 37.769231 | 77 | 0.643585 | import argparse
import os
import numpy as np
import autosklearn
import autosklearn.data
import autosklearn.data.data_manager
import autosklearn.models.evaluator
from ParamSklearn.classification import ParamSklearnClassifier
parser = argparse.ArgumentParser()
parser.add_argument('input')
parser.add_argument('output'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d8118cea63144b40121b86ebd76b91465e950f07 | 40 | py | Python | test/login.py | cjy3516/learn_git | 42a71a8420b0c47bce314dc6e8de0ce2c7686dc5 | [
"MIT"
] | 1 | 2019-05-12T09:16:41.000Z | 2019-05-12T09:16:41.000Z | test/login.py | cjy3516/learn_git | 42a71a8420b0c47bce314dc6e8de0ce2c7686dc5 | [
"MIT"
] | null | null | null | test/login.py | cjy3516/learn_git | 42a71a8420b0c47bce314dc6e8de0ce2c7686dc5 | [
"MIT"
] | null | null | null | print('...')
a = 0
b = 1
c = 2
d = 3
| 6.666667 | 15 | 0.4 | print('登陆中...')
a = 0
b = 1
c = 2
d = 3
| 9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
242afb1e0d6046ecb3beb8109113b8d0aaf8b3f6 | 2,167 | py | Python | tests/internals/utils/test_utils.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | tests/internals/utils/test_utils.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | tests/internals/utils/test_utils.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null |
import pytest
does_raise = pytest.raises(TypeError, match="(?i).*(isinstance|subclass|implement).*")
| 26.753086 | 91 | 0.673281 | from contextlib import contextmanager
import pytest
from typing_extensions import Annotated, Protocol, runtime_checkable
from antidote._internal.utils import enforce_subclass_if_possible, enforce_type_if_possible
@contextmanager
def does_not_raise():
yield
does_raise = pytest.raises(TypeError, match="(?i).*(i... | 0 | 1,560 | 0 | 111 | 0 | 0 | 0 | 133 | 251 |
5dc9f68356aa5dfaac46f4824e525645d1114957 | 1,197 | py | Python | scrapy_store_project/scraper/pipelines.py | MaksNech/pylab2018_ht_22 | 5c862b23203e93bf4cbdf5f1e5777f29052f2f69 | [
"MIT"
] | null | null | null | scrapy_store_project/scraper/pipelines.py | MaksNech/pylab2018_ht_22 | 5c862b23203e93bf4cbdf5f1e5777f29052f2f69 | [
"MIT"
] | 10 | 2020-02-11T23:54:49.000Z | 2022-03-11T23:42:36.000Z | scrapy_store_project/scraper/pipelines.py | MaksNech/pylab2018_ht_22 | 5c862b23203e93bf4cbdf5f1e5777f29052f2f69 | [
"MIT"
] | 1 | 2020-12-02T09:32:19.000Z | 2020-12-02T09:32:19.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
import sys
import django
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.append(os.path.join(BASE_DI... | 25.468085 | 78 | 0.680033 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
import sys
import django
from scrapy import signals
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.... | 0 | 172 | 0 | 526 | 0 | 0 | 0 | 24 | 68 |
2ebcb304719c846a96b450a872767c09f6975bff | 311 | py | Python | rouge.py | googlx/lasertagger | 3c4ecad69fa9c45f934f83a0db534490da702679 | [
"Apache-2.0"
] | 1 | 2021-04-10T00:51:41.000Z | 2021-04-10T00:51:41.000Z | rouge.py | googlx/lasertagger | 3c4ecad69fa9c45f934f83a0db534490da702679 | [
"Apache-2.0"
] | 3 | 2020-11-13T18:56:44.000Z | 2022-02-10T01:59:32.000Z | rouge.py | googlx/lasertagger | 3c4ecad69fa9c45f934f83a0db534490da702679 | [
"Apache-2.0"
] | null | null | null | from utils_rouge import rouge_eval, rouge_log
rouge_ref_dir = './output/reference'
rouge_dec_dir = './output/decoded'
print("Decoder has finished reading dataset for single_pass.")
print("Now starting ROUGE eval...")
results_dict = rouge_eval(rouge_ref_dir, rouge_dec_dir)
rouge_log(results_dict, './output')
| 31.1 | 62 | 0.787781 | from utils_rouge import rouge_eval, rouge_log
rouge_ref_dir = './output/reference'
rouge_dec_dir = './output/decoded'
print("Decoder has finished reading dataset for single_pass.")
print("Now starting ROUGE eval...")
results_dict = rouge_eval(rouge_ref_dir, rouge_dec_dir)
rouge_log(results_dict, './output')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
72726e3efa4ceff6e72a25841f7fa6e76f621db3 | 11,010 | py | Python | models/record.py | ourresearch/openalex-guts | f6c3e9992361e4bb1dbe76fbfb644c80f081319a | [
"MIT"
] | 48 | 2021-11-20T08:17:53.000Z | 2022-03-19T13:57:15.000Z | models/record.py | ourresearch/openalex-guts | f6c3e9992361e4bb1dbe76fbfb644c80f081319a | [
"MIT"
] | null | null | null | models/record.py | ourresearch/openalex-guts | f6c3e9992361e4bb1dbe76fbfb644c80f081319a | [
"MIT"
] | 2 | 2022-01-04T16:28:48.000Z | 2022-02-05T21:25:01.000Z |
# alter table recordthresher_record add column started_label text;
# alter table recordthresher_record add column started datetime;
# alter table recordthresher_record add column finished datetime;
# alter table recordthresher_record add column work_id bigint
work_type_strings = """
lookup_string,work_type,d... | 36.456954 | 142 | 0.675114 | from cached_property import cached_property
from sqlalchemy import text
from sqlalchemy import orm
from sqlalchemy.orm import selectinload
from sqlalchemy.sql.expression import func
from sqlalchemy.orm import deferred
from sqlalchemy.orm import foreign, remote
from collections import defaultdict
from time import sleep
... | 0 | 818 | 0 | 6,326 | 0 | 0 | 0 | 123 | 310 |
b44e6ad1f6b98b54aff50079a3affbf13f219dbe | 77 | py | Python | vmaig_blog/uwsgi-2.0.14/plugins/ldap/uwsgiplugin.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | 1 | 2018-11-24T16:10:49.000Z | 2018-11-24T16:10:49.000Z | vmaig_blog/uwsgi-2.0.14/plugins/ldap/uwsgiplugin.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | null | null | null | vmaig_blog/uwsgi-2.0.14/plugins/ldap/uwsgiplugin.py | StanYaha/Blog | 3cb38918e14ebe6ce2e2952ef272de116849910d | [
"BSD-3-Clause"
] | null | null | null |
NAME='ldap'
CFLAGS = []
LDFLAGS = []
LIBS = ['-lldap']
GCC_LIST = ['ldap']
| 9.625 | 19 | 0.545455 |
NAME='ldap'
CFLAGS = []
LDFLAGS = []
LIBS = ['-lldap']
GCC_LIST = ['ldap']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d72fb4f4b08de98dc8f334b02950346f14ca7c43 | 9,548 | py | Python | meregistro/apps/registro/views/extension_aulica_matricula.py | MERegistro/meregistro | 6cde3cab2bd1a8e3084fa38147de377d229391e3 | [
"BSD-3-Clause"
] | null | null | null | meregistro/apps/registro/views/extension_aulica_matricula.py | MERegistro/meregistro | 6cde3cab2bd1a8e3084fa38147de377d229391e3 | [
"BSD-3-Clause"
] | null | null | null | meregistro/apps/registro/views/extension_aulica_matricula.py | MERegistro/meregistro | 6cde3cab2bd1a8e3084fa38147de377d229391e3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
ITEMS_PER_PAGE = 50
def build_query(filters, page, request):
"""
Construye el query de bsqueda a partir de los filtros.
"""
return filters.buildQuery().order_by('establecimiento__nombre', 'cue').filter(ambito__path__istartswith=request.get_perfil().ambito.path)
def build_q... | 39.949791 | 144 | 0.730519 | # -*- coding: UTF-8 -*-
from django.http import HttpResponseRedirect
from datetime import datetime
from django.core.urlresolvers import reverse
from django.core.paginator import Paginator
from meregistro.shortcuts import my_render
from apps.seguridad.decorators import login_required, credential_required
from apps.segu... | 28 | 7,810 | 0 | 0 | 0 | 0 | 0 | 723 | 514 |
3138f874a431daafafc80599313e8cd2516eb070 | 740 | py | Python | MoleculeACE/benchmark/models/load_model.py | molML/MoleculeACE | e831d2371a9b89f4853a03d5c04cc4bf59f64ee0 | [
"MIT"
] | 9 | 2022-03-26T17:36:03.000Z | 2022-03-29T19:50:26.000Z | MoleculeACE/benchmark/models/load_model.py | molML/MoleculeACE | e831d2371a9b89f4853a03d5c04cc4bf59f64ee0 | [
"MIT"
] | null | null | null | MoleculeACE/benchmark/models/load_model.py | molML/MoleculeACE | e831d2371a9b89f4853a03d5c04cc4bf59f64ee0 | [
"MIT"
] | null | null | null | """
Load a model
Derek van Tilborg, Eindhoven University of Technology, March 2022
"""
from MoleculeACE.benchmark.utils.const import Algorithms
from .model import Model
def load_model(data, algorithm: Algorithms, model_file: str):
""" Train a machine learning model
Args:
data: MoleculeACE.benchmark.... | 30.833333 | 119 | 0.739189 | """
Load a model
Derek van Tilborg, Eindhoven University of Technology, March 2022
"""
from MoleculeACE.benchmark.utils.const import Algorithms
from .model import Model
def load_model(data, algorithm: Algorithms, model_file: str):
""" Train a machine learning model
Args:
data: MoleculeACE.benchmark.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e19a008abc0f729a065a03a7a7ec3e045a8f7896 | 17,710 | py | Python | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/xmcAlgorithm.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | null | null | null | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/xmcAlgorithm.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | null | null | null | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/xmcAlgorithm.py | lkusch/Kratos | e8072d8e24ab6f312765185b19d439f01ab7b27b | [
"BSD-4-Clause"
] | null | null | null |
# XMC imports
# Import ExaQUte API
| 43.513514 | 189 | 0.636025 | import pickle
import pathlib as pl
from typing import List
# XMC imports
from xmc.tools import dynamicImport, splitOneListIntoTwo
from xmc.methodDefs_xmcAlgorithm import checkInitialisation
# Import ExaQUte API
from exaqute import get_value_from_remote
class XMCAlgorithm:
"""
This top-level class handles t... | 30 | 0 | 0 | 17,420 | 0 | 0 | 0 | 86 | 156 |
8b275c92ddd27f3d075cae19768279407b485228 | 27,985 | py | Python | examples/ex_trust_cognitive_architecture/ex_trust_cognitive_architecture_4yo.py | riccardobrue/SOM-example-1 | 8a977e73844f9206ee1704be577f8a7521d2b306 | [
"MIT"
] | null | null | null | examples/ex_trust_cognitive_architecture/ex_trust_cognitive_architecture_4yo.py | riccardobrue/SOM-example-1 | 8a977e73844f9206ee1704be577f8a7521d2b306 | [
"MIT"
] | null | null | null | examples/ex_trust_cognitive_architecture/ex_trust_cognitive_architecture_4yo.py | riccardobrue/SOM-example-1 | 8a977e73844f9206ee1704be577f8a7521d2b306 | [
"MIT"
] | 1 | 2021-03-16T16:02:16.000Z | 2021-03-16T16:02:16.000Z | #!/usr/bin/python
## Massimiliano Patacchiola, Plymouth University 2016
import numpy as np
#Informant reputation is evaluated considering: agent_action, agent_confidence, informant_action
#If the confidence of the agent is high and the action suggested is different from the action taken
#then the informant is evalua... | 66.002358 | 184 | 0.697802 | #!/usr/bin/python
## Massimiliano Patacchiola, Plymouth University 2016
import numpy as np
import os
import time
from scipy import spatial
#Informant reputation is evaluated considering: agent_action, agent_confidence, informant_action
#If the confidence of the agent is high and the action suggested is different fr... | 0 | 0 | 0 | 0 | 0 | 16,219 | 0 | -18 | 113 |
08abed566828c755c6dafae9abf66653c5f6ec0e | 4,352 | py | Python | aditiplot/aditiplot.py | lanery/aditiplot | 3a5ca99060e9628e590880e379795613f2d4164c | [
"CC-BY-4.0"
] | null | null | null | aditiplot/aditiplot.py | lanery/aditiplot | 3a5ca99060e9628e590880e379795613f2d4164c | [
"CC-BY-4.0"
] | null | null | null | aditiplot/aditiplot.py | lanery/aditiplot | 3a5ca99060e9628e590880e379795613f2d4164c | [
"CC-BY-4.0"
] | null | null | null | import seaborn as sns
def deorganize(data, x=None, y=None, hue=None, size=None, style=None, **kwargs):
"""Make some chaos
The idea is that we want to use as many plotting dimensions
(e.g. marker color, marker shape, etc.) as possible when
we plot our data. So given a multidimensional dataset,... | 32.237037 | 81 | 0.570083 | import seaborn as sns
def deorganize(data, x=None, y=None, hue=None, size=None, style=None, **kwargs):
"""Make some chaos
The idea is that we want to use as many plotting dimensions
(e.g. marker color, marker shape, etc.) as possible when
we plot our data. So given a multidimensional dataset,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a7cc991e8ac47a75b3836911d13cef1016b921af | 4,177 | py | Python | backend/app/widget/widget_routes.py | timmyjose-projects/learn | 57ef1d9282a367a35de67a951d6c7a7d91ee9a6a | [
"CC-BY-4.0"
] | null | null | null | backend/app/widget/widget_routes.py | timmyjose-projects/learn | 57ef1d9282a367a35de67a951d6c7a7d91ee9a6a | [
"CC-BY-4.0"
] | null | null | null | backend/app/widget/widget_routes.py | timmyjose-projects/learn | 57ef1d9282a367a35de67a951d6c7a7d91ee9a6a | [
"CC-BY-4.0"
] | null | null | null | from flask import Blueprint, make_response
from flask_cors import CORS
widget_bp = Blueprint('widget_bp', __name__)
CORS(widget_bp)
def compose_response(obj, code):
"""
Utility method to create a response
:param obj:
The object to respond with
:param code:
The HTTP code to send
:r... | 32.379845 | 117 | 0.659804 | from flask import Blueprint, make_response, request, send_file
from flask import current_app as app
from flask_cors import CORS
from queue import Empty
from kombu import Queue
import json
import sys
from . import tasks, celery
from .project import Project
widget_bp = Blueprint('widget_bp', __name__)
CORS(widget_bp)... | 0 | 3,481 | 0 | 0 | 0 | 0 | 0 | 31 | 226 |
791c1e4b4625ee8f12eaea11c5edb36cf51710a8 | 1,186 | py | Python | gym/configuration.py | JialinMao/gym-ww | dad1b3313e5e5c767c189f2f43ace8097f2ff7bf | [
"MIT"
] | 6 | 2017-01-30T22:06:12.000Z | 2020-02-18T08:56:27.000Z | gym/configuration.py | JialinMao/gym-ww | dad1b3313e5e5c767c189f2f43ace8097f2ff7bf | [
"MIT"
] | null | null | null | gym/configuration.py | JialinMao/gym-ww | dad1b3313e5e5c767c189f2f43ace8097f2ff7bf | [
"MIT"
] | 9 | 2016-10-04T13:51:28.000Z | 2020-10-14T13:42:09.000Z | import logging
import sys
import gym
logger = logging.getLogger(__name__)
root_logger = logging.getLogger()
requests_logger = logging.getLogger('requests')
# Set up the default handler
formatter = logging.Formatter('[%(asctime)s] %(message)s')
handler = logging.StreamHandler(sys.stderr)
handler.setFormatter(formatt... | 31.210526 | 77 | 0.758853 | import logging
import sys
import gym
logger = logging.getLogger(__name__)
root_logger = logging.getLogger()
requests_logger = logging.getLogger('requests')
# Set up the default handler
formatter = logging.Formatter('[%(asctime)s] %(message)s')
handler = logging.StreamHandler(sys.stderr)
handler.setFormatter(formatt... | 0 | 0 | 0 | 0 | 0 | 220 | 0 | 0 | 22 |
2ca07aa75baba2d9f619917a32e68963b82b48a3 | 6,614 | py | Python | jpp_boosted_django/jpp_boosted/models/models.py | QualmandDriven/jpp_boosted | 895e2e85a7b0dd2fcfc6f2352fc318f2555e16df | [
"MIT"
] | 1 | 2020-07-28T19:36:51.000Z | 2020-07-28T19:36:51.000Z | jpp_boosted_django/jpp_boosted/models/models.py | QualmandDriven/jpp_boosted | 895e2e85a7b0dd2fcfc6f2352fc318f2555e16df | [
"MIT"
] | 11 | 2020-06-05T22:37:24.000Z | 2022-02-10T08:25:59.000Z | jpp_boosted_django/jpp_boosted/models/models.py | QualmandDriven/jpp_boosted | 895e2e85a7b0dd2fcfc6f2352fc318f2555e16df | [
"MIT"
] | null | null | null |
# Create your models here.
| 32.106796 | 156 | 0.710916 | from django.db import models
import re
# Create your models here.
class YouTubeVideo(models.Model):
created = models.DateTimeField(auto_now_add=True)
url = models.URLField(max_length=100)
title = models.CharField(max_length=100)
city = models.CharField(max_length=100)
country = models.CharFie... | 0 | 0 | 0 | 6,189 | 0 | 0 | 0 | -5 | 393 |
58496e8aefc44d1f04acb865c600842d4da38e18 | 4,903 | py | Python | automol/reac/_rot.py | sjklipp/autochem | ac343a4bc5ff8c9a75e75d7ed717ea2db659b7a0 | [
"Apache-2.0"
] | 1 | 2021-03-01T14:21:08.000Z | 2021-03-01T14:21:08.000Z | automol/reac/_rot.py | avcopan/autochem | 19d9b0402568170ae5ca0adecb460d36f258a9bd | [
"Apache-2.0"
] | null | null | null | automol/reac/_rot.py | avcopan/autochem | 19d9b0402568170ae5ca0adecb460d36f258a9bd | [
"Apache-2.0"
] | null | null | null | """ rotational bond/torsion info for specific reaction classes
"""
from automol.par import ReactionClass
import automol.zmat
from automol.reac._util import hydrogen_abstraction_atom_keys
from automol.reac._util import substitution_atom_keys
# Bimolecular reactions
# 1. Hydrogen abstractions
def hydrogen_abstraction_l... | 34.528169 | 77 | 0.698756 | """ rotational bond/torsion info for specific reaction classes
"""
from automol.par import ReactionClass
import automol.zmat
from automol.reac._util import hydrogen_abstraction_atom_keys
from automol.reac._util import substitution_atom_keys
# Bimolecular reactions
# 1. Hydrogen abstractions
def hydrogen_abstraction_l... | 0 | 0 | 0 | 0 | 0 | 225 | 0 | 0 | 27 |
a18905de8d28998daeecfe3659f1fa4e2de8517f | 7,341 | py | Python | makeMKV/model/title.py | coolman565/blu_two | 5c7626145b3644570be99ff0267f88bd61b9806c | [
"MIT"
] | null | null | null | makeMKV/model/title.py | coolman565/blu_two | 5c7626145b3644570be99ff0267f88bd61b9806c | [
"MIT"
] | 1 | 2021-06-01T21:57:23.000Z | 2021-06-01T21:57:23.000Z | makeMKV/model/title.py | coolman565/blu_two | 5c7626145b3644570be99ff0267f88bd61b9806c | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 37.454082 | 115 | 0.583572 | import logging
from typing import Dict
from makeMKV.model.enum.item_attribute_id import ItemAttributeId
from makeMKV.model.enum.item_info import ItemInfo
from makeMKV.model.enum.stream_type import StreamType
from makeMKV.model.stream import Stream, VideoStream, SubtitleStream, AudioStream
logger = logging.getLogger(_... | 0 | 0 | 0 | 6,988 | 0 | 0 | 0 | 165 | 134 |
40317c43fa10080de33cb6aa239d4efddfdd1a2d | 7,106 | py | Python | beatbrain/generator/cvae_keras.py | Emrys-Hong/BeatBrain | 68159d9cc46d85e73afdc5aa5341c45158dc1b28 | [
"MIT"
] | 1 | 2020-03-28T21:18:50.000Z | 2020-03-28T21:18:50.000Z | beatbrain/generator/cvae_keras.py | Emrys-Hong/BeatBrain | 68159d9cc46d85e73afdc5aa5341c45158dc1b28 | [
"MIT"
] | null | null | null | beatbrain/generator/cvae_keras.py | Emrys-Hong/BeatBrain | 68159d9cc46d85e73afdc5aa5341c45158dc1b28 | [
"MIT"
] | null | null | null | import time
import tensorflow as tf
from operator import mul
from functools import reduce
from tqdm import tqdm
from . import data_utils
from .. import settings
tf.compat.v1.enable_eager_execution()
# region Model hyperparameters
window_size = settings.WINDOW_SIZE
image_dims = [settings.CHUNK_SIZE, settings.N... | 34.495146 | 111 | 0.684914 | import os
import time
import numpy as np
import tensorflow as tf
from operator import mul
from functools import reduce
from pathlib import Path
from datetime import datetime
from tqdm import tqdm
from PIL import Image
from . import data_utils
from .. import settings
tf.compat.v1.enable_eager_execution()
def log_nor... | 0 | 637 | 0 | 0 | 0 | 1,468 | 0 | -4 | 248 |
4bbfc96feb84bff49cd2671b5c01825ad4c226cf | 2,182 | py | Python | src/reformat-stanford-dataset.py | Diover/tell-the-dog-breed | 89581306dbc5d87d592bfd6f481310927053df42 | [
"MIT"
] | null | null | null | src/reformat-stanford-dataset.py | Diover/tell-the-dog-breed | 89581306dbc5d87d592bfd6f481310927053df42 | [
"MIT"
] | null | null | null | src/reformat-stanford-dataset.py | Diover/tell-the-dog-breed | 89581306dbc5d87d592bfd6f481310927053df42 | [
"MIT"
] | null | null | null |
#save_data_to_folders("../input")
| 34.634921 | 114 | 0.644363 | import numpy as np
import pandas as pd
import os
import re
from os.path import join
from os import path, makedirs, rename
from tqdm import tqdm
def get_new_name(folder_name, labels):
folder_name = folder_name.lower()
breed_name_regex = re.compile("[n\d]+-(?P<breed_name>[\w_]+)")
breed_name = breed_name_re... | 0 | 0 | 0 | 0 | 0 | 1,955 | 0 | -10 | 200 |
dc18b4ed104910515c5ef026a2a7a10acb908ced | 2,807 | py | Python | mak/libs/waflib/extras/slow_qt4.py | motor-dev/Motor | 98cb099fe1c2d31e455ed868cc2a25eae51e79f0 | [
"BSD-3-Clause"
] | 4 | 2015-05-13T16:28:36.000Z | 2017-05-24T15:34:14.000Z | mak/libs/waflib/extras/slow_qt4.py | motor-dev/Motor | 98cb099fe1c2d31e455ed868cc2a25eae51e79f0 | [
"BSD-3-Clause"
] | null | null | null | mak/libs/waflib/extras/slow_qt4.py | motor-dev/Motor | 98cb099fe1c2d31e455ed868cc2a25eae51e79f0 | [
"BSD-3-Clause"
] | 1 | 2017-03-21T08:28:07.000Z | 2017-03-21T08:28:07.000Z | #! /usr/bin/env python
# Thomas Nagy, 2011 (ita)
"""
Create _moc.cpp files
The builds are 30-40% faster when .moc files are included,
you should NOT use this tool. If you really
really want it:
def configure(conf):
conf.load('compiler_cxx qt4')
conf.load('slow_qt4')
See playground/slow_qt/wscript for a complete e... | 28.938144 | 107 | 0.666548 | #! /usr/bin/env python
# Thomas Nagy, 2011 (ita)
"""
Create _moc.cpp files
The builds are 30-40% faster when .moc files are included,
you should NOT use this tool. If you really
really want it:
def configure(conf):
conf.load('compiler_cxx qt4')
conf.load('slow_qt4')
See playground/slow_qt/wscript for a complete e... | 0 | 85 | 0 | 2,233 | 0 | 0 | 0 | 19 | 113 |
eca64f46b859dc9f0fbbfd0c3722289c89299a99 | 1,233 | py | Python | easyrepr/decorator.py | chrisbouchard/autorepr | 59946af44564db65639d468b30fcd3cfad282c49 | [
"MIT"
] | 2 | 2021-12-15T05:46:05.000Z | 2022-03-16T00:07:39.000Z | easyrepr/decorator.py | chrisbouchard/autorepr | 59946af44564db65639d468b30fcd3cfad282c49 | [
"MIT"
] | 11 | 2021-09-29T17:56:04.000Z | 2021-12-21T02:14:57.000Z | easyrepr/decorator.py | chrisbouchard/autorepr | 59946af44564db65639d468b30fcd3cfad282c49 | [
"MIT"
] | 1 | 2021-12-26T01:41:43.000Z | 2021-12-26T01:41:43.000Z |
__all__ = ["easyrepr"]
def easyrepr(wrapped=None, **kwargs):
"""Decorator for an automatic `__repr__` method.
:param wrapped: the function to wrap
See `.descriptor.EasyRepr` for a full description of the accepted
keyword parameters.
This decorator wraps a function (which is available as `__wr... | 24.66 | 78 | 0.621249 | from .descriptor import EasyRepr
__all__ = ["easyrepr"]
def easyrepr(wrapped=None, **kwargs):
"""Decorator for an automatic `__repr__` method.
:param wrapped: the function to wrap
See `.descriptor.EasyRepr` for a full description of the accepted
keyword parameters.
This decorator wraps a func... | 0 | 0 | 0 | 0 | 0 | 47 | 0 | 11 | 49 |
ddee3bcaf51c31126dfa9a4b6fb2c255d2036969 | 384 | py | Python | authors/apps/comments/migrations/0003_likes_liked.py | KabohaJeanMark/ah-backend-invictus | a9cf930934e8cbcb4ee370a088df57abe50ee6d6 | [
"BSD-3-Clause"
] | 7 | 2021-03-04T09:29:13.000Z | 2021-03-17T17:35:42.000Z | authors/apps/comments/migrations/0003_likes_liked.py | KabohaJeanMark/ah-backend-invictus | a9cf930934e8cbcb4ee370a088df57abe50ee6d6 | [
"BSD-3-Clause"
] | 25 | 2019-04-23T18:51:02.000Z | 2021-06-10T21:22:47.000Z | authors/apps/comments/migrations/0003_likes_liked.py | KabohaJeanMark/ah-backend-invictus | a9cf930934e8cbcb4ee370a088df57abe50ee6d6 | [
"BSD-3-Clause"
] | 7 | 2019-06-29T10:40:38.000Z | 2019-09-23T09:05:45.000Z | # Generated by Django 2.1 on 2019-05-07 15:15
| 20.210526 | 53 | 0.598958 | # Generated by Django 2.1 on 2019-05-07 15:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comments', '0002_auto_20190506_0926'),
]
operations = [
migrations.AddField(
model_name='likes',
name='liked',
... | 0 | 0 | 0 | 272 | 0 | 0 | 0 | 19 | 46 |
5ef82217f4a6311a3d779e3237bb3b4d02f8267c | 1,066 | py | Python | tests/test_cli.py | tucked/isilon_hadoop_tools | 8fb5aa704109f4e8e07b79e65cb81acca0e3ec57 | [
"MIT"
] | 16 | 2016-07-14T17:27:11.000Z | 2020-09-22T22:45:43.000Z | tests/test_cli.py | tucked/isilon_hadoop_tools | 8fb5aa704109f4e8e07b79e65cb81acca0e3ec57 | [
"MIT"
] | 70 | 2016-07-29T04:59:27.000Z | 2022-03-30T22:12:44.000Z | tests/test_cli.py | tucked/isilon_hadoop_tools | 8fb5aa704109f4e8e07b79e65cb81acca0e3ec57 | [
"MIT"
] | 18 | 2016-07-29T04:28:09.000Z | 2022-03-29T07:41:55.000Z | """Verify the functionality of isilon_hadoop_tools.cli."""
from __future__ import absolute_import
from __future__ import unicode_literals
try:
from unittest.mock import Mock # Python 3
except ImportError:
from mock import Mock # Python 2
import pytest
from isilon_hadoop_tools import cli
def test_catche... | 26.65 | 69 | 0.731707 | """Verify the functionality of isilon_hadoop_tools.cli."""
from __future__ import absolute_import
from __future__ import unicode_literals
try:
from unittest.mock import Mock # Python 3
except ImportError:
from mock import Mock # Python 2
import pytest
from isilon_hadoop_tools import IsilonHadoopToolError... | 0 | 362 | 0 | 0 | 0 | 0 | 0 | 23 | 23 |
38a4bc7f77a764d1ad0c2c9ab7b92edbd8bcb694 | 1,571 | py | Python | lc0647_palindromic_substrings.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | 8 | 2019-03-18T06:37:24.000Z | 2022-01-30T07:50:58.000Z | lc0647_palindromic_substrings.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | lc0647_palindromic_substrings.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | """Leetcode 647. Palindromic Substrings
Medium
URL: https://leetcode.com/problems/palindromic-substrings/
Given a string, your task is to count how many palindromic substrings in this string.
The substrings with different start indexes or end indexes are counted as different
substrings even they consist of same char... | 24.169231 | 85 | 0.623806 | """Leetcode 647. Palindromic Substrings
Medium
URL: https://leetcode.com/problems/palindromic-substrings/
Given a string, your task is to count how many palindromic substrings in this string.
The substrings with different start indexes or end indexes are counted as different
substrings even they consist of same char... | 0 | 0 | 0 | 776 | 0 | 179 | 0 | 0 | 46 |
d326a9b07b474852b322ea28e418922f966869c6 | 702 | py | Python | sources/tools.py | bmstu-iu8-g1-2019-project/road_signs_recognition | 72adbf7b08dc74c9b8a202275ac40d794f12d2dc | [
"MIT"
] | 1 | 2019-09-27T19:33:37.000Z | 2019-09-27T19:33:37.000Z | sources/tools.py | bmstu-iu8-g1-2019-project/road_signs_recognition | 72adbf7b08dc74c9b8a202275ac40d794f12d2dc | [
"MIT"
] | 1 | 2019-10-28T20:30:14.000Z | 2019-10-28T20:30:14.000Z | sources/tools.py | bmstu-iu8-g1-2019-project/road_signs_recognition | 72adbf7b08dc74c9b8a202275ac40d794f12d2dc | [
"MIT"
] | null | null | null | from keras.preprocessing.image import load_img
if __name__ == '__main__':
img = load_img('../dataset/validation/0000000.jpg', target_size=(1280, 720))
img.show() | 28.08 | 80 | 0.611111 | import os
import numpy as np
from keras.preprocessing.image import load_img
def versionize(versions_dir,
root,
insides=('configs', 'weights')):
versions = os.listdir(versions_dir)
if not versions:
version = 0
else:
version = max([int(ver[len(root) + 2:]) for v... | 0 | 0 | 0 | 0 | 0 | 478 | 0 | -15 | 67 |
927fbf32a39787eb7d2bcd4be43f67d8d71cd118 | 4,970 | py | Python | Same.py | Naomi-Hiebert/intersectional-same | 5ea42206b6ad416b40245420ce886301b57a9bbc | [
"MIT"
] | null | null | null | Same.py | Naomi-Hiebert/intersectional-same | 5ea42206b6ad416b40245420ce886301b57a9bbc | [
"MIT"
] | null | null | null | Same.py | Naomi-Hiebert/intersectional-same | 5ea42206b6ad416b40245420ce886301b57a9bbc | [
"MIT"
] | null | null | null | import pyglet
import BlockArray
#magic numbers
blockSize = 24
pointSize = 6
halfBorder = 1.0
height = 24
width = 36
#ugly global variables for visual effects
hoverGroup = []
#initialize the most important data structure
blocks = BlockArray.BlockArray(width, height)
#initialize the graphics
window = pyglet.window.... | 26.43617 | 86 | 0.694165 | import pyglet
import Block
import BlockArray
import random
#magic numbers
blockSize = 24
pointSize = 6
halfBorder = 1.0
height = 24
width = 36
#ugly global variables for visual effects
hoverGroup = []
#initialize the most important data structure
blocks = BlockArray.BlockArray(width, height)
#initialize the graph... | 0 | 1,478 | 0 | 0 | 0 | 1,264 | 0 | -17 | 230 |
4deaf032a0e878f01886779007c8e1a12aab8710 | 647 | py | Python | insta/migrations/0009_auto_20210713_0642.py | ndanu-josy/Instagram | e8b189b06e8c9326a680759b06fd85462c49d124 | [
"MIT"
] | null | null | null | insta/migrations/0009_auto_20210713_0642.py | ndanu-josy/Instagram | e8b189b06e8c9326a680759b06fd85462c49d124 | [
"MIT"
] | null | null | null | insta/migrations/0009_auto_20210713_0642.py | ndanu-josy/Instagram | e8b189b06e8c9326a680759b06fd85462c49d124 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-13 06:42
| 25.88 | 97 | 0.622875 | # Generated by Django 3.2.5 on 2021-07-13 06:42
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('insta', '0008_auto_20210713_0636'),
]
operations = [
migrations.AlterField(
model_name='image',
nam... | 0 | 0 | 0 | 516 | 0 | 0 | 0 | 14 | 68 |
bc8067c0d0a0d0d36e472d88ed41e7fd71b84766 | 2,124 | py | Python | tests/benchmarks/test_onell_benchmark.py | ndangtt/LeadingOnesDAC | 953747d8702f179851d7973c65779a1f830e03a1 | [
"Apache-2.0"
] | 11 | 2020-11-09T10:50:31.000Z | 2022-02-19T09:23:44.000Z | tests/benchmarks/test_onell_benchmark.py | ndangtt/LeadingOnesDAC | 953747d8702f179851d7973c65779a1f830e03a1 | [
"Apache-2.0"
] | 95 | 2020-11-18T09:37:30.000Z | 2022-02-17T10:05:33.000Z | tests/benchmarks/test_onell_benchmark.py | ndangtt/LeadingOnesDAC | 953747d8702f179851d7973c65779a1f830e03a1 | [
"Apache-2.0"
] | 11 | 2020-11-15T15:24:27.000Z | 2022-03-14T14:51:43.000Z |
# TestOneLLBenchmark().test_get_env()
# TestOneLLBenchmark().test_scenarios()
# TestOneLLBenchmark().test_read_instances()
# TestOneLLBenchmark().test_save_conf()
| 34.819672 | 111 | 0.637947 | import unittest
import json
import os
from dacbench.benchmarks import OneLLBenchmark
from dacbench.envs import OneLLEnv
class TestOneLLBenchmark(unittest.TestCase):
def test_get_env(self):
bench = OneLLBenchmark()
env = bench.get_environment()
self.assertTrue(issubclass(type(env), OneLLEn... | 0 | 0 | 0 | 1,814 | 0 | 0 | 0 | 10 | 134 |
f20837dfb121c64fcbd0b514ab3bd6c8694c95da | 11,701 | py | Python | tests/test_blend_modes.py | facelessuser/coloraide | c273cb652f75941b95ad8ddc8becc9873b97f085 | [
"MIT"
] | 30 | 2020-10-11T05:47:51.000Z | 2022-03-22T06:05:33.000Z | tests/test_blend_modes.py | nisancigokmen/coloraide | 2707323cbd440e8e75fd58dd4092a5d036f07bd6 | [
"MIT"
] | 139 | 2020-10-20T15:28:57.000Z | 2022-03-31T23:44:18.000Z | tests/test_blend_modes.py | nisancigokmen/coloraide | 2707323cbd440e8e75fd58dd4092a5d036f07bd6 | [
"MIT"
] | 3 | 2021-08-29T13:25:12.000Z | 2021-12-22T19:58:11.000Z | """Test Blend modes."""
# Colors that produce pretty distinct results
REDISH = '#fc3d99'
BLUISH = '#07c7ed'
YELLOWISH = '#f5d311'
| 55.719048 | 118 | 0.658576 | """Test Blend modes."""
import unittest
from coloraide import Color
from . import util
# Colors that produce pretty distinct results
REDISH = '#fc3d99'
BLUISH = '#07c7ed'
YELLOWISH = '#f5d311'
class TestBlendModes(util.ColorAsserts, unittest.TestCase):
"""Test blend modes."""
def test_alpha(self):
"... | 0 | 0 | 0 | 11,483 | 0 | 0 | 0 | -3 | 89 |