hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70eda886905b05d99fcfd52ab749c90f86d04df | 2,185 | py | Python | budweiser/budweiser.py | lukebeer/budweiser | 8e77377c5952375f74371229d1d770cb1efe176f | [
"MIT"
] | null | null | null | budweiser/budweiser.py | lukebeer/budweiser | 8e77377c5952375f74371229d1d770cb1efe176f | [
"MIT"
] | null | null | null | budweiser/budweiser.py | lukebeer/budweiser | 8e77377c5952375f74371229d1d770cb1efe176f | [
"MIT"
] | null | null | null | __author__ = 'luke.beer'
import subprocess
import threading
import logging
import socket
import time
import questions
import states
class Executor(threading.Thread):
def __init__(self, r, channel):
threading.Thread.__init__(self)
self.redis = r
self.channel = channel
self.pubsub =... | 32.132353 | 113 | 0.585812 | __author__ = 'luke.beer'
import subprocess
import threading
import logging
import socket
import time
import questions
import states
class Executor(threading.Thread):
def __init__(self, r, channel):
threading.Thread.__init__(self)
self.redis = r
self.channel = channel
self.pubsub =... | true | true |
f70edb0bd9f3d76f8d1b1327fa9458f595a64ab3 | 3,738 | py | Python | rule1to6_words.py | e96031413/proofread | f4fc798d3b57c6f7a55f4e18de68f2272eb9fc44 | [
"MIT"
] | null | null | null | rule1to6_words.py | e96031413/proofread | f4fc798d3b57c6f7a55f4e18de68f2272eb9fc44 | [
"MIT"
] | null | null | null | rule1to6_words.py | e96031413/proofread | f4fc798d3b57c6f7a55f4e18de68f2272eb9fc44 | [
"MIT"
] | null | null | null | import re
import json
from color_print import *
# read rules from json file
with open("rules.json", "r", encoding="utf-8") as json_data:
rules = json.load(json_data)
# create new rules by replacing 'is' to 'was', 'has been', ...
def augment(sentence):
"""change 'is' in the sentence to was, has been,... | 41.076923 | 98 | 0.593098 | import re
import json
from color_print import *
with open("rules.json", "r", encoding="utf-8") as json_data:
rules = json.load(json_data)
def augment(sentence):
pad_sentence = " " + sentence + " "
augmented_str = [pad_sentence]
if 'is' in pad_sentence:
index = pad_sentence.find("i... | true | true |
f70edd2a8408b41deb049f6068375e7a834dd31f | 17,816 | py | Python | examples/optics/pyoptic.py | abbasegbeyemi/pyqtgraph | 6aeafce477d1d7eebb9d2fe824d4c5573ef9ceed | [
"MIT"
] | 1 | 2021-04-28T05:16:24.000Z | 2021-04-28T05:16:24.000Z | examples/optics/pyoptic.py | abbasegbeyemi/pyqtgraph | 6aeafce477d1d7eebb9d2fe824d4c5573ef9ceed | [
"MIT"
] | 1 | 2021-04-04T15:05:47.000Z | 2021-05-15T23:56:42.000Z | examples/optics/pyoptic.py | abbasegbeyemi/pyqtgraph | 6aeafce477d1d7eebb9d2fe824d4c5573ef9ceed | [
"MIT"
] | 1 | 2021-05-19T10:11:17.000Z | 2021-05-19T10:11:17.000Z | # -*- coding: utf-8 -*-
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import csv, gzip, os
from pyqtgraph import Point
class GlassDB:
"""
Database of dispersion coefficients for Schott glasses
+ Corning 7980
"""
def __init__(self, fileName='schott_glasses.csv'):
... | 31.701068 | 119 | 0.516446 |
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import csv, gzip, os
from pyqtgraph import Point
class GlassDB:
def __init__(self, fileName='schott_glasses.csv'):
path = os.path.dirname(__file__)
fh = gzip.open(os.path.join(path, 'schott_glasses.csv.gz'), 'rb')
... | true | true |
f70eddb35e62f56ceb999ef8f00c042b5f03b8cb | 22,177 | py | Python | src/app_server/tasks/proto/task_pb2.py | ArneGudermann/app_server | f28179861dd96766610ddc3867dbe1285eb8fcbc | [
"MIT"
] | null | null | null | src/app_server/tasks/proto/task_pb2.py | ArneGudermann/app_server | f28179861dd96766610ddc3867dbe1285eb8fcbc | [
"MIT"
] | null | null | null | src/app_server/tasks/proto/task_pb2.py | ArneGudermann/app_server | f28179861dd96766610ddc3867dbe1285eb8fcbc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/tasks_v2/proto/task.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _... | 37.909402 | 1,822 | 0.632908 |
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
... | true | true |
f70eddcaeb1d3f78ffc1a296a080675447ca2f91 | 1,215 | py | Python | game/plugins/amblight/amblight.py | danieldugas/naith | 04c85412c93ea1572f3146ddadae39af3dc9e9f7 | [
"Apache-2.0"
] | 5 | 2015-07-12T04:26:10.000Z | 2021-03-23T19:56:45.000Z | game/plugins/amblight/amblight.py | danieldugas/naith | 04c85412c93ea1572f3146ddadae39af3dc9e9f7 | [
"Apache-2.0"
] | 1 | 2015-04-11T07:03:04.000Z | 2018-07-18T11:12:38.000Z | game/plugins/amblight/amblight.py | danieldugas/naith | 04c85412c93ea1572f3146ddadae39af3dc9e9f7 | [
"Apache-2.0"
] | 3 | 2016-01-12T13:58:29.000Z | 2021-05-26T12:55:07.000Z | # Copyright Tom SF Haines, Reinier de Blois, Aaron Snoswell
#
# 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... | 31.153846 | 107 | 0.730864 |
from panda3d.core import VBase4
from panda3d.core import AmbientLight as PAmbientLight
class AmbLight:
def __init__(self,manager,xml):
self.light = PAmbientLight('alight')
self.lightNode = render.attachNewNode(self.light)
self.reload(manager,xml)
def reload(self,manager,xml):
colo... | true | true |
f70edf1a09050130a9565a23e6e442da972cb095 | 3,196 | py | Python | machine_learning/tf_notMNIST_Training_Gradient_Descent.py | XinyueZ/some-python-codes | 2d7296a4deebb0cd086be34ad7d66f5042cdf6e6 | [
"Unlicense"
] | null | null | null | machine_learning/tf_notMNIST_Training_Gradient_Descent.py | XinyueZ/some-python-codes | 2d7296a4deebb0cd086be34ad7d66f5042cdf6e6 | [
"Unlicense"
] | null | null | null | machine_learning/tf_notMNIST_Training_Gradient_Descent.py | XinyueZ/some-python-codes | 2d7296a4deebb0cd086be34ad7d66f5042cdf6e6 | [
"Unlicense"
] | null | null | null | #
# Run NN, multinomial logistic regression using simple gradient descent.
#
import config
import numpy as np
import tensorflow as tf
from tensorflow import (Variable, constant, global_variables_initializer,
truncated_normal, zeros)
from tf_training_helper import TrainingHelper
class TF_notMN... | 40.974359 | 186 | 0.682728 |
import config
import numpy as np
import tensorflow as tf
from tensorflow import (Variable, constant, global_variables_initializer,
truncated_normal, zeros)
from tf_training_helper import TrainingHelper
class TF_notMNIST_Training_Gradient_Descent:
def __init__(self, each_object_size_wid... | true | true |
f70edfed142a1adff7c6e18b38c7bde60881368c | 35,539 | py | Python | peprint/peprint.py | tommikaikkonen/peprint | 7248ae6f92f1b05b2c9089ce69280120ad4fcd69 | [
"MIT"
] | 3 | 2017-10-24T08:35:18.000Z | 2017-12-18T03:23:19.000Z | peprint/peprint.py | tommikaikkonen/peprint | 7248ae6f92f1b05b2c9089ce69280120ad4fcd69 | [
"MIT"
] | null | null | null | peprint/peprint.py | tommikaikkonen/peprint | 7248ae6f92f1b05b2c9089ce69280120ad4fcd69 | [
"MIT"
] | null | null | null | import inspect
import math
import re
from functools import singledispatch, partial
from itertools import chain, cycle
from .api import (
always_break,
annotate,
concat,
contextual,
flat_choice,
fill,
group,
nest,
NIL,
LINE,
SOFTLINE,
HARDLINE
)
from .doc import (
Ann... | 26.305699 | 88 | 0.552886 | import inspect
import math
import re
from functools import singledispatch, partial
from itertools import chain, cycle
from .api import (
always_break,
annotate,
concat,
contextual,
flat_choice,
fill,
group,
nest,
NIL,
LINE,
SOFTLINE,
HARDLINE
)
from .doc import (
Ann... | true | true |
f70ee17398871ce80a6a796f7ad57bf07638ed4a | 2,933 | py | Python | fastai/callback/tensorboard.py | mone27/fastai | af8dfc07ca3f333f8c1bdbea1803af669a53738f | [
"Apache-2.0"
] | 5 | 2020-08-27T00:52:27.000Z | 2022-03-31T02:46:05.000Z | fastai/callback/tensorboard.py | mone27/fastai | af8dfc07ca3f333f8c1bdbea1803af669a53738f | [
"Apache-2.0"
] | 22 | 2021-01-07T23:35:00.000Z | 2022-03-20T00:16:40.000Z | fastai/callback/tensorboard.py | mone27/fastai | af8dfc07ca3f333f8c1bdbea1803af669a53738f | [
"Apache-2.0"
] | 2 | 2021-04-17T03:33:21.000Z | 2022-02-25T19:32:34.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/71_callback.tensorboard.ipynb (unless otherwise specified).
__all__ = ['TensorBoardCallback']
# Cell
from ..basics import *
# Cell
import tensorboard
from torch.utils.tensorboard import SummaryWriter
from .fp16 import ModelToHalf
# Cell
class TensorBoardCallback(Callb... | 41.309859 | 116 | 0.663484 |
__all__ = ['TensorBoardCallback']
from ..basics import *
import tensorboard
from torch.utils.tensorboard import SummaryWriter
from .fp16 import ModelToHalf
class TensorBoardCallback(Callback):
def __init__(self, log_dir=None, trace_model=True, log_preds=True, n_preds=9):
store_attr(self, 'log_dir,tr... | true | true |
f70ee1a5cbe2ca7f5dad96cb3fc51ffba04714a7 | 4,057 | py | Python | plugins/action/session_service_node_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | plugins/action/session_service_node_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | plugins/action/session_service_node_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
try:
from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import (
AnsibleArgSpecValidator,
)
except ImportError:
ANSIBLE_UTILS_IS_INST... | 35.902655 | 128 | 0.627064 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
try:
from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import (
AnsibleArgSpecValidator,
)
except ImportError:
ANSIBLE_UTILS_IS_INST... | true | true |
f70ee1ba459f4fe70e554fa936e19ebdb676d822 | 10,877 | py | Python | azure-batch/azure/batch/models/cloud_pool.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-batch/azure/batch/models/cloud_pool.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-batch/azure/batch/models/cloud_pool.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of ... | 56.651042 | 695 | 0.717753 |
from msrest.serialization import Model
class CloudPool(Model):
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'url': {'key': 'url', 'type': 'str'},
'e_tag': {'key': 'eTag', 'type': 'str'},
... | true | true |
f70ee258c4ab57190cefb9567f8aebd2ad94bf85 | 8,509 | py | Python | utils/inout.py | alarca94/senti-transfer | da83a072c8d471bc74aa25b237b5e301502db869 | [
"MIT"
] | null | null | null | utils/inout.py | alarca94/senti-transfer | da83a072c8d471bc74aa25b237b5e301502db869 | [
"MIT"
] | null | null | null | utils/inout.py | alarca94/senti-transfer | da83a072c8d471bc74aa25b237b5e301502db869 | [
"MIT"
] | null | null | null | import os
import yaml
import pandas as pd
import xml.etree.ElementTree as ET
from types import SimpleNamespace
from sklearn.model_selection import train_test_split
from utils.experiment_utils import create_linspace
from utils.preprocess import *
SOURCE_PATH = './source_data'
DATA_PATH = './data'
CONFIG_PATH = './c... | 41.916256 | 120 | 0.616289 | import os
import yaml
import pandas as pd
import xml.etree.ElementTree as ET
from types import SimpleNamespace
from sklearn.model_selection import train_test_split
from utils.experiment_utils import create_linspace
from utils.preprocess import *
SOURCE_PATH = './source_data'
DATA_PATH = './data'
CONFIG_PATH = './c... | true | true |
f70ee2731d6b20084634923bada7c3aa114f534c | 2,124 | py | Python | django/contrib/admin/templatetags/log.py | tomleo/django | ebfb71c64a786620947c9d598fd1ebae2958acff | [
"BSD-3-Clause"
] | 1 | 2017-12-01T06:26:57.000Z | 2017-12-01T06:26:57.000Z | django/contrib/admin/templatetags/log.py | liuliang2015/django | 86d3079d5797811c1e118cfd600a913685212165 | [
"BSD-3-Clause"
] | null | null | null | django/contrib/admin/templatetags/log.py | liuliang2015/django | 86d3079d5797811c1e118cfd600a913685212165 | [
"BSD-3-Clause"
] | 1 | 2020-04-12T19:00:12.000Z | 2020-04-12T19:00:12.000Z | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | 37.263158 | 141 | 0.653955 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | true | true |
f70ee2ccfbf232fca633a434e05e913a78eb9412 | 19,418 | py | Python | LTAR_Flux_QC.py | cafltar/CAF_EC_Column_Rename | 7375678081d8931f34e7ab8b4a6e02eca112e721 | [
"MIT"
] | null | null | null | LTAR_Flux_QC.py | cafltar/CAF_EC_Column_Rename | 7375678081d8931f34e7ab8b4a6e02eca112e721 | [
"MIT"
] | null | null | null | LTAR_Flux_QC.py | cafltar/CAF_EC_Column_Rename | 7375678081d8931f34e7ab8b4a6e02eca112e721 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Aug 21 15:53:46 2018
@author: Eric S. Russell
Laboratory for Atmospheric Research
Dept. of Civil and Environmental Engineering
Washington State University
eric.s.russell@wsu.edu
Not all of these functions are used in the column rename script; these are potentially to be used... | 50.832461 | 177 | 0.575136 |
import numpy as np
import pandas as pd
import datetime
def Grade_cs(df,info, Site, site=False):
if site == True:
grade = int(info['grade'][Site])
LE_B = [float(info['LEL'][Site]),float(info['LEU'][Site])]
H_B = [float(info['HL'][Site]),float(info['HU'][Site])]
F_B = [float(i... | true | true |
f70ee2f8b953fcf7d3eace5aa1239816e97a391b | 102 | py | Python | ch_05/if.py | berchev/python_learning | 5b99065cade53c64b4ede3d0e583c58573ca654c | [
"MIT"
] | null | null | null | ch_05/if.py | berchev/python_learning | 5b99065cade53c64b4ede3d0e583c58573ca654c | [
"MIT"
] | null | null | null | ch_05/if.py | berchev/python_learning | 5b99065cade53c64b4ede3d0e583c58573ca654c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
ph = float(input('enter pH level: '))
if ph < 7.0:
print(ph, "is acidic")
| 14.571429 | 37 | 0.588235 |
ph = float(input('enter pH level: '))
if ph < 7.0:
print(ph, "is acidic")
| true | true |
f70ee3ce2302cf60a5ab6d4a9e15b021694ced9e | 1,791 | py | Python | tests/cli_tests/test_command_input.py | itamarhaber/iredis | 61208aab34c731f88232abd2cacdf0e075e701f2 | [
"BSD-3-Clause"
] | 1,857 | 2019-08-09T02:36:13.000Z | 2022-03-31T05:53:09.000Z | tests/cli_tests/test_command_input.py | itamarhaber/iredis | 61208aab34c731f88232abd2cacdf0e075e701f2 | [
"BSD-3-Clause"
] | 281 | 2019-08-08T16:00:59.000Z | 2022-03-07T14:05:36.000Z | tests/cli_tests/test_command_input.py | itamarhaber/iredis | 61208aab34c731f88232abd2cacdf0e075e701f2 | [
"BSD-3-Clause"
] | 105 | 2019-08-09T04:36:12.000Z | 2022-02-03T13:27:29.000Z | import os
import pytest
def test_wrong_select_db_index(cli):
cli.sendline("select 1")
cli.expect(["OK", "127.0.0.1"])
cli.sendline("select 128")
cli.expect(["DB index is out of range", "127.0.0.1:6379[1]>"])
if int(os.environ["REDIS_VERSION"]) > 5:
text = "value is not an integer or out ... | 23.88 | 82 | 0.647125 | import os
import pytest
def test_wrong_select_db_index(cli):
cli.sendline("select 1")
cli.expect(["OK", "127.0.0.1"])
cli.sendline("select 128")
cli.expect(["DB index is out of range", "127.0.0.1:6379[1]>"])
if int(os.environ["REDIS_VERSION"]) > 5:
text = "value is not an integer or out ... | true | true |
f70ee48502d9ed246520453354000d57c64db59a | 1,103 | py | Python | src/check_setup.py | imagexdsearch/imagesearch | 7f4d18906d6ebd9f5d7b4e0db4bc6c7e675fbb1d | [
"BSD-2-Clause"
] | 4 | 2018-05-15T10:57:49.000Z | 2019-11-18T23:00:42.000Z | src/check_setup.py | imagexdsearch/imagesearch | 7f4d18906d6ebd9f5d7b4e0db4bc6c7e675fbb1d | [
"BSD-2-Clause"
] | null | null | null | src/check_setup.py | imagexdsearch/imagesearch | 7f4d18906d6ebd9f5d7b4e0db4bc6c7e675fbb1d | [
"BSD-2-Clause"
] | 2 | 2018-05-16T20:20:02.000Z | 2021-11-24T16:14:38.000Z | import sys
from distutils.version import LooseVersion
if sys.version_info.major < 3:
print('[!] You are running an old version of Python. '
'This tutorial requires Python 3.')
sys.exit(1)
with open('requirements.txt') as f:
reqs = f.readlines()
reqs = [(pkg, ver) for (pkg, _, ver) in
(... | 25.651163 | 74 | 0.579329 | import sys
from distutils.version import LooseVersion
if sys.version_info.major < 3:
print('[!] You are running an old version of Python. '
'This tutorial requires Python 3.')
sys.exit(1)
with open('requirements.txt') as f:
reqs = f.readlines()
reqs = [(pkg, ver) for (pkg, _, ver) in
(... | true | true |
f70ee59ad2fff7af06efafd5608c2cdd3cb0a977 | 299 | py | Python | contests/2020.1/rinha_de_calouros/pacotes/M/solver/solver.py | bkpedrosuper/brute_class | fa41e9206d74de394e2dd69f0afa556d1630a39d | [
"MIT"
] | null | null | null | contests/2020.1/rinha_de_calouros/pacotes/M/solver/solver.py | bkpedrosuper/brute_class | fa41e9206d74de394e2dd69f0afa556d1630a39d | [
"MIT"
] | null | null | null | contests/2020.1/rinha_de_calouros/pacotes/M/solver/solver.py | bkpedrosuper/brute_class | fa41e9206d74de394e2dd69f0afa556d1630a39d | [
"MIT"
] | null | null | null | from math import ceil
S, D = [int(i) for i in input().split()]
cont = [0 for i in range(S)]
for d in range(D):
t = [int(i) for i in input().split()]
for i in range(S):
cont[i] += t[i]
media = ceil(sum(cont) / D)
pref = cont.index(max(cont))
print(str(media))
print(str(pref + 1))
| 19.933333 | 41 | 0.575251 | from math import ceil
S, D = [int(i) for i in input().split()]
cont = [0 for i in range(S)]
for d in range(D):
t = [int(i) for i in input().split()]
for i in range(S):
cont[i] += t[i]
media = ceil(sum(cont) / D)
pref = cont.index(max(cont))
print(str(media))
print(str(pref + 1))
| true | true |
f70ee767186d8fcd993c43b14c72310227172b6e | 2,246 | py | Python | voxelgrid/tsdf/run_tsdf_fusion.py | n1ckfg/RoutedFusion | 1733911c7fe025b461b75e48461658709996e39c | [
"BSD-3-Clause"
] | null | null | null | voxelgrid/tsdf/run_tsdf_fusion.py | n1ckfg/RoutedFusion | 1733911c7fe025b461b75e48461658709996e39c | [
"BSD-3-Clause"
] | null | null | null | voxelgrid/tsdf/run_tsdf_fusion.py | n1ckfg/RoutedFusion | 1733911c7fe025b461b75e48461658709996e39c | [
"BSD-3-Clause"
] | null | null | null | #!/scratch_net/nudel/esandstroem/venvs/tsdf_fusion_env/bin/python
import os
app_path = '/scratch_net/nudel/esandstroem/venvs/tsdf_fusion_env/bin'
os.environ["PATH"] = app_path + os.pathsep + os.environ["PATH"]
from TSDFHandle import *
import numpy as np
import cv2
from utils import extract_mesh_marching_cubes
from vis... | 39.403509 | 113 | 0.714604 |
import os
app_path = '/scratch_net/nudel/esandstroem/venvs/tsdf_fusion_env/bin'
os.environ["PATH"] = app_path + os.pathsep + os.environ["PATH"]
from TSDFHandle import *
import numpy as np
import cv2
from utils import extract_mesh_marching_cubes
from visualization import plot_mesh
import plyfile
from sys import argv
i... | true | true |
f70eeb6bd74cdee12b83b651d78589e6981087b7 | 3,266 | py | Python | tests/util/test_get_descendants.py | xiangze/edward | 6419751d1d849c84c502e5ff3f7249b9bbc7b3aa | [
"Apache-2.0"
] | 5,200 | 2016-05-03T04:59:01.000Z | 2022-03-31T03:32:26.000Z | tests/util/test_get_descendants.py | xiangze/edward | 6419751d1d849c84c502e5ff3f7249b9bbc7b3aa | [
"Apache-2.0"
] | 724 | 2016-05-04T09:04:37.000Z | 2022-02-28T02:41:12.000Z | tests/util/test_get_descendants.py | xiangze/edward | 6419751d1d849c84c502e5ff3f7249b9bbc7b3aa | [
"Apache-2.0"
] | 1,004 | 2016-05-03T22:45:14.000Z | 2022-03-25T00:08:08.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from edward.models import Bernoulli, Normal
from edward.util import get_descendants
class test_get_descendants_class(tf.test.TestCase):
def test_v_structure(self):
"""a -> b ->... | 33.326531 | 66 | 0.600122 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from edward.models import Bernoulli, Normal
from edward.util import get_descendants
class test_get_descendants_class(tf.test.TestCase):
def test_v_structure(self):
with self.te... | true | true |
f70eed1e1375e4432d0c54f717dd6b0c81d354b9 | 2,024 | py | Python | deepvariant/core/proto_utils.py | ishandutta2007/deepvariant | f1684281b3ded6c68a1d4bc89f7848b7cedac548 | [
"BSD-3-Clause"
] | 1 | 2019-05-09T21:56:48.000Z | 2019-05-09T21:56:48.000Z | deepvariant/core/proto_utils.py | Joyvalley/deepvariant | b3a5bced5720f8a27080a5330e64295f16bbd46c | [
"BSD-3-Clause"
] | null | null | null | deepvariant/core/proto_utils.py | Joyvalley/deepvariant | b3a5bced5720f8a27080a5330e64295f16bbd46c | [
"BSD-3-Clause"
] | 1 | 2017-12-23T04:27:06.000Z | 2017-12-23T04:27:06.000Z | # Copyright 2017 Google Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#... | 47.069767 | 80 | 0.764822 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from google.protobuf.internal import api_implementation
def uses_fast_cpp_protos_or_die():
if api_implementation.Type() != 'cpp':
raise ValueError('Expected to be using C++ ... | true | true |
f70eedf59fe8f614e603477963743fd9b0c5b712 | 1,764 | py | Python | libweasyl/libweasyl/conftest.py | hyena/weasyl | a43ad885eb07ae89d6639f289a5b95f3a177439c | [
"Apache-2.0"
] | 1 | 2019-02-15T04:21:48.000Z | 2019-02-15T04:21:48.000Z | libweasyl/libweasyl/conftest.py | hyena/weasyl | a43ad885eb07ae89d6639f289a5b95f3a177439c | [
"Apache-2.0"
] | 254 | 2017-12-23T19:36:43.000Z | 2020-04-14T21:46:13.000Z | libweasyl/libweasyl/conftest.py | hyena/weasyl | a43ad885eb07ae89d6639f289a5b95f3a177439c | [
"Apache-2.0"
] | 1 | 2017-12-23T18:42:16.000Z | 2017-12-23T18:42:16.000Z | import os
import pytest
import sqlalchemy as sa
from libweasyl.configuration import configure_libweasyl
from libweasyl.models.meta import registry
from libweasyl.models.tables import metadata
from libweasyl.test.common import NotFound
from libweasyl.test.common import media_link_formatter
from libweasyl import cache
... | 28.451613 | 113 | 0.713719 | import os
import pytest
import sqlalchemy as sa
from libweasyl.configuration import configure_libweasyl
from libweasyl.models.meta import registry
from libweasyl.models.tables import metadata
from libweasyl.test.common import NotFound
from libweasyl.test.common import media_link_formatter
from libweasyl import cache
... | true | true |
f70eee367e175b617f0f5ce115780567e62dbda0 | 2,081 | py | Python | device.py | seank-com/iot-device-python | f862a2b4bf5a6e2eee0546c287fc0ffdfbd08945 | [
"MIT"
] | null | null | null | device.py | seank-com/iot-device-python | f862a2b4bf5a6e2eee0546c287fc0ffdfbd08945 | [
"MIT"
] | null | null | null | device.py | seank-com/iot-device-python | f862a2b4bf5a6e2eee0546c287fc0ffdfbd08945 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import time
import sys
import iothub_client
from iothub_client import IoTHubClient, IoTHubClientError, IoTHubTransportProvider, IoTHubClientResult
from iothub_client import IoTHubMessage, IoTHubMessageDispositionResult, IoTHubError
# String containing Hostname, Device Id & Device Key in the form... | 34.114754 | 104 | 0.713119 |
import time
import sys
import iothub_client
from iothub_client import IoTHubClient, IoTHubClientError, IoTHubTransportProvider, IoTHubClientResult
from iothub_client import IoTHubMessage, IoTHubMessageDispositionResult, IoTHubError
CONNECTION_STRING = "[Device Connection String]"
MSG_TXT = "{\"msg\": \"%s\"}"
RE... | true | true |
f70eee72ebaef7bb1e9932648eb79dff211b82c2 | 390 | py | Python | algo/implementation/easy/time.py | rivergillis/hackerrank-practice | 16b1d448c011f22b202b1ccadac09c71f646aa5e | [
"MIT"
] | null | null | null | algo/implementation/easy/time.py | rivergillis/hackerrank-practice | 16b1d448c011f22b202b1ccadac09c71f646aa5e | [
"MIT"
] | null | null | null | algo/implementation/easy/time.py | rivergillis/hackerrank-practice | 16b1d448c011f22b202b1ccadac09c71f646aa5e | [
"MIT"
] | null | null | null | import sys
time = input().strip()
splitted = time.split(':')
hours_12 = int(splitted[0])
mins = splitted[1]
secs = splitted[2][:2]
is_pm = splitted[2].endswith("PM")
if (is_pm):
if (hours_12 >= 1 and hours_12 < 12): # between 1pm and 11:59pm
hours_12 += 12
else:
if (hours_12 == 12):
hours_... | 18.571429 | 68 | 0.602564 | import sys
time = input().strip()
splitted = time.split(':')
hours_12 = int(splitted[0])
mins = splitted[1]
secs = splitted[2][:2]
is_pm = splitted[2].endswith("PM")
if (is_pm):
if (hours_12 >= 1 and hours_12 < 12):
hours_12 += 12
else:
if (hours_12 == 12):
hours_12 -= 12
print(':'.join(... | true | true |
f70eefb7329c2c9517976ab1418f9cdd7cacbee9 | 14,654 | py | Python | parlai/agents/transformer/mixer.py | dongfangyixi/ParlAI | 424a2b3c7086593f699c76612dffd1d925986177 | [
"MIT"
] | null | null | null | parlai/agents/transformer/mixer.py | dongfangyixi/ParlAI | 424a2b3c7086593f699c76612dffd1d925986177 | [
"MIT"
] | null | null | null | parlai/agents/transformer/mixer.py | dongfangyixi/ParlAI | 424a2b3c7086593f699c76612dffd1d925986177 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Transformer Agents.
"""
from typing import Optional
from parlai.core.params import ParlaiParser
from parlai.core.opt i... | 32.348786 | 88 | 0.602702 |
from typing import Optional
from parlai.core.params import ParlaiParser
from parlai.core.opt import Opt
from parlai.core.agents import Agent
from parlai.utils.torch import padded_3d
from parlai.core.torch_classifier_agent import TorchClassifierAgent
from parlai.core.torch_ranker_agent import TorchRankerAgent
from p... | true | true |
f70ef0ac0372c717352edce2b5da38e908ee6060 | 31,508 | py | Python | Keras_tensorflow/source/tensorflow/core/protobuf/config_pb2.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 60 | 2017-08-05T21:47:56.000Z | 2022-03-08T21:46:29.000Z | Keras_tensorflow/source/tensorflow/core/protobuf/config_pb2.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 1 | 2017-08-22T07:17:47.000Z | 2017-09-24T22:04:19.000Z | Keras_tensorflow/source/tensorflow/core/protobuf/config_pb2.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 11 | 2017-09-10T16:22:21.000Z | 2021-08-09T09:24:50.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/protobuf/config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf imp... | 43.161644 | 3,662 | 0.758601 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
f70ef0f412e5276c5b8da11a1ad63834bedea5f9 | 593 | py | Python | venv/lib/python3.6/site-packages/gensim/__init__.py | bopopescu/wired_cli | 844b5c2bf32c95ad2974663f0501a85ff6134bd4 | [
"MIT"
] | 2 | 2021-06-09T20:55:17.000Z | 2021-11-03T03:07:37.000Z | venv/lib/python3.6/site-packages/gensim/__init__.py | bopopescu/wired_cli | 844b5c2bf32c95ad2974663f0501a85ff6134bd4 | [
"MIT"
] | 4 | 2020-07-26T02:10:42.000Z | 2021-03-31T18:48:58.000Z | venv/lib/python3.6/site-packages/gensim/__init__.py | bopopescu/wired_cli | 844b5c2bf32c95ad2974663f0501a85ff6134bd4 | [
"MIT"
] | 1 | 2020-07-25T23:57:23.000Z | 2020-07-25T23:57:23.000Z | """This package contains interfaces and functionality to compute pair-wise document similarities within a corpus
of documents.
"""
from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401
import logging
__version__ = '3.5.0'
class NullHandler(logging.Handler... | 28.238095 | 114 | 0.726813 |
from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils
import logging
__version__ = '3.5.0'
class NullHandler(logging.Handler):
def emit(self, record):
pass
logger = logging.getLogger('gensim')
if len(logger.handlers) == 0:
logger.addHandler(Null... | true | true |
f70ef1c1fcfaa212ff2a8e28ee9bafc3b2b10d8d | 3,514 | py | Python | intersight/models/boot_san_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | intersight/models/boot_san_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | intersight/models/boot_san_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-262
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class BootSanRef(object):
"""
NOTE: This class is a... | 23.426667 | 77 | 0.529027 |
from pprint import pformat
from six import iteritems
import re
class BootSanRef(object):
swagger_types = {
'moid': 'str',
'object_type': 'str'
}
attribute_map = {
'moid': 'Moid',
'object_type': 'ObjectType'
}
def __init__(self, moid=None, object_type=None):
... | true | true |
f70ef231f97b1c04885674e7f2bc0a4b3632a20f | 1,296 | py | Python | modules/file_utils.py | Efemache/Mercenaries-Hearthstone-game-bot | a243275dddc484f09fd87272277e9d9baca5f3ee | [
"Apache-2.0"
] | 6 | 2022-03-03T03:41:00.000Z | 2022-03-25T23:08:12.000Z | modules/file_utils.py | Efemache/Mercenaries-Farm-bot | 0eb6bdb10e282606570456f33c071b488eaf02cf | [
"Apache-2.0"
] | 37 | 2021-11-25T16:14:20.000Z | 2022-03-30T21:12:05.000Z | modules/file_utils.py | Efemache/Mercenaries-Hearthstone-game-bot | a243275dddc484f09fd87272277e9d9baca5f3ee | [
"Apache-2.0"
] | 3 | 2022-02-18T03:41:22.000Z | 2022-03-22T02:11:41.000Z | import json
import configparser
import re
import logging
from modules.exceptions import SettingsError
log = logging.getLogger(__name__)
def readjson(jfile):
"""... just for reading json file and return data :)"""
with open(jfile) as descriptor:
data = json.load(descriptor)
return data
def read... | 25.411765 | 81 | 0.611111 | import json
import configparser
import re
import logging
from modules.exceptions import SettingsError
log = logging.getLogger(__name__)
def readjson(jfile):
with open(jfile) as descriptor:
data = json.load(descriptor)
return data
def read_ini_to_dict(inifile):
log.debug("Reading %s", inifile)
... | true | true |
f70ef372c774d66de4efbfa2589caab790ff166a | 156 | py | Python | python/pictures/base64_to_pic.py | livejq/AutoScripts | b801e68515c6cdb6ddadc9c499a21276774d3d74 | [
"MIT"
] | 11 | 2021-05-21T16:12:21.000Z | 2022-02-03T10:21:13.000Z | python/pictures/base64_to_pic.py | livejq/AutoScripts | b801e68515c6cdb6ddadc9c499a21276774d3d74 | [
"MIT"
] | null | null | null | python/pictures/base64_to_pic.py | livejq/AutoScripts | b801e68515c6cdb6ddadc9c499a21276774d3d74 | [
"MIT"
] | 5 | 2021-05-21T16:30:19.000Z | 2022-01-06T16:15:08.000Z | # -*- coding:utf-8 -*-
import base64
bs='iVBORw0KGgoAAAANSUhEUg....'
imgdata=base64.b64decode(bs)
file=open('2.jpg','wb')
file.write(imgdata)
file.close()
| 17.333333 | 31 | 0.698718 |
import base64
bs='iVBORw0KGgoAAAANSUhEUg....'
imgdata=base64.b64decode(bs)
file=open('2.jpg','wb')
file.write(imgdata)
file.close()
| true | true |
f70ef3994d20c14340d01f4ee1f72727c196fd1b | 233,632 | py | Python | sdk/python/pulumi_azure_native/network/v20160901/outputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/network/v20160901/outputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/network/v20160901/outputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 40.674095 | 368 | 0.647077 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
__all__ = [
'AddressSpaceResponse',
'ApplicationGatewayAuthenticationCertificateResponse',
'ApplicationGatewayBa... | true | true |
f70ef43cb2465a8a7aace46d8fa63d92a517dfb1 | 591 | py | Python | webware/MiddleKit/Core/StringAttr.py | PeaceWorksTechnologySolutions/w4py3-middlekit | a9554e20c47010e7b0c0deee63e1786482c59a1c | [
"MIT"
] | 2 | 2020-10-31T09:12:58.000Z | 2021-02-20T13:52:14.000Z | webware/MiddleKit/Core/StringAttr.py | WebwareForPython/w4py3-middlekit | f740e2d2d3a5c225d6b8f9eb27ac08f8deed47e6 | [
"MIT"
] | 2 | 2020-01-07T15:24:09.000Z | 2020-01-08T15:39:57.000Z | webware/MiddleKit/Core/StringAttr.py | PeaceWorksTechnologySolutions/w4py3-middlekit | a9554e20c47010e7b0c0deee63e1786482c59a1c | [
"MIT"
] | 1 | 2021-09-27T21:04:18.000Z | 2021-09-27T21:04:18.000Z | from .BasicTypeAttr import BasicTypeAttr
class StringAttr(BasicTypeAttr):
def __init__(self, attr):
BasicTypeAttr.__init__(self, attr)
if self.get('Max') is not None:
self['Max'] = int(self['Max'])
if self.get('Min') is not None:
self['Min'] = int(self['Min'])
... | 34.764706 | 97 | 0.57868 | from .BasicTypeAttr import BasicTypeAttr
class StringAttr(BasicTypeAttr):
def __init__(self, attr):
BasicTypeAttr.__init__(self, attr)
if self.get('Max') is not None:
self['Max'] = int(self['Max'])
if self.get('Min') is not None:
self['Min'] = int(self['Min'])
... | true | true |
f70ef508b4fa96a799589b3ae368486bd1d19c73 | 184 | py | Python | src/naive/Python/Numba/fib.py | juliancoffee/fib | c337ccc570dfb692d015ff4f1155d44925f8f47f | [
"MIT"
] | 4 | 2019-07-29T22:19:23.000Z | 2021-01-22T05:27:39.000Z | src/naive/Python/Numba/fib.py | juliancoffee/fib | c337ccc570dfb692d015ff4f1155d44925f8f47f | [
"MIT"
] | 2 | 2019-06-13T18:14:53.000Z | 2019-06-14T17:24:37.000Z | src/naive/Python/Numba/fib.py | juliancoffee/fib | c337ccc570dfb692d015ff4f1155d44925f8f47f | [
"MIT"
] | 8 | 2019-06-10T09:37:25.000Z | 2019-06-30T07:55:02.000Z | from numba import jit
import sys
@jit
def fib(n):
return 1 if n < 3 else fib(n-1) + fib(n-2)
if __name__ == "__main__":
n = int(sys.argv[1])
print("{}".format(fib(n)))
| 14.153846 | 46 | 0.581522 | from numba import jit
import sys
@jit
def fib(n):
return 1 if n < 3 else fib(n-1) + fib(n-2)
if __name__ == "__main__":
n = int(sys.argv[1])
print("{}".format(fib(n)))
| true | true |
f70ef56c468100d0c372ae156de34620904d237e | 12,703 | py | Python | tests/generate_go_ethereum_fixture.py | happyuc-project/webu.py | 5a01124fc84d74df09a33d9dabe88b704cd5b6c6 | [
"MIT"
] | null | null | null | tests/generate_go_ethereum_fixture.py | happyuc-project/webu.py | 5a01124fc84d74df09a33d9dabe88b704cd5b6c6 | [
"MIT"
] | null | null | null | tests/generate_go_ethereum_fixture.py | happyuc-project/webu.py | 5a01124fc84d74df09a33d9dabe88b704cd5b6c6 | [
"MIT"
] | null | null | null | import contextlib
import json
import os
import pprint
import shutil
import signal
import socket
import subprocess
import sys
import tempfile
import time
from cytoolz import (
merge,
valmap,
)
from eth_utils.curried import (
apply_formatter_if,
is_bytes,
is_checksum_address,
is_dict,
is_same... | 30.389952 | 522 | 0.664646 | import contextlib
import json
import os
import pprint
import shutil
import signal
import socket
import subprocess
import sys
import tempfile
import time
from cytoolz import (
merge,
valmap,
)
from eth_utils.curried import (
apply_formatter_if,
is_bytes,
is_checksum_address,
is_dict,
is_same... | true | true |
f70ef5c61dda827100835b501bf9c0da123c3708 | 4,333 | py | Python | bayesopt/graph_features.py | xingchenwan/nasbowl | 0abaa91b6ce436655a7488f75ed5aeca8df71246 | [
"MIT"
] | 18 | 2020-12-29T13:00:19.000Z | 2022-03-30T08:34:47.000Z | bayesopt/graph_features.py | xingchenwan/nasbowl | 0abaa91b6ce436655a7488f75ed5aeca8df71246 | [
"MIT"
] | 1 | 2021-07-16T18:03:26.000Z | 2021-08-30T09:20:29.000Z | bayesopt/graph_features.py | xingchenwan/nasbowl | 0abaa91b6ce436655a7488f75ed5aeca8df71246 | [
"MIT"
] | 4 | 2021-03-22T06:18:34.000Z | 2022-03-11T16:00:03.000Z | import networkx as nx
class FeatureExtractor:
"""
Extracting some hand-crafted x1_features for the x1_graphs
- Number of (effective nodes)
- Average
"""
def __init__(self, g: nx.Graph, node_attr_name='op_name', s='input', t='output'):
"""
g: a valid networkx graph
node... | 38.6875 | 121 | 0.596354 | import networkx as nx
class FeatureExtractor:
def __init__(self, g: nx.Graph, node_attr_name='op_name', s='input', t='output'):
self.g = g
self.input_index = []
self.output_index = None
for n in range(g.number_of_nodes()):
assert node_attr_name in list(dict(g.nodes[n])... | true | true |
f70ef64b5fe5985fc2fd93a3b677151ca2461f5b | 3,423 | py | Python | src/datasets/hits_dataset.py | ReyesDeJong/Deep-SVDD-PyTorch | 1fc7eae1474556f869d5c5422da74fd4fe2f1aed | [
"MIT"
] | null | null | null | src/datasets/hits_dataset.py | ReyesDeJong/Deep-SVDD-PyTorch | 1fc7eae1474556f869d5c5422da74fd4fe2f1aed | [
"MIT"
] | null | null | null | src/datasets/hits_dataset.py | ReyesDeJong/Deep-SVDD-PyTorch | 1fc7eae1474556f869d5c5422da74fd4fe2f1aed | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
import pandas as pd
from torch.utils.data import Subset
from torch.utils.data.dataset import Dataset # For custom datasets
from torchvision import transforms
PROJECT_PATH = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..'))
sys.path.append(PROJECT_PATH)
... | 34.928571 | 76 | 0.71078 | import os
import sys
import numpy as np
import pandas as pd
from torch.utils.data import Subset
from torch.utils.data.dataset import Dataset
from torchvision import transforms
PROJECT_PATH = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..'))
sys.path.append(PROJECT_PATH)
from src.base.torchv... | true | true |
f70ef760aea72079f6af72ed3c3cacc7a63ab723 | 8,321 | py | Python | sdk/python/pulumi_mongodbatlas/teams.py | pulumi/pulumi-mongodbatlas | 0d5c085dcfd871b56fb4cf582620260b70caa07a | [
"ECL-2.0",
"Apache-2.0"
] | 9 | 2020-04-28T19:12:30.000Z | 2022-03-22T23:04:46.000Z | sdk/python/pulumi_mongodbatlas/teams.py | pulumi/pulumi-mongodbatlas | 0d5c085dcfd871b56fb4cf582620260b70caa07a | [
"ECL-2.0",
"Apache-2.0"
] | 59 | 2020-06-12T12:12:52.000Z | 2022-03-28T18:14:50.000Z | sdk/python/pulumi_mongodbatlas/teams.py | pulumi/pulumi-mongodbatlas | 0d5c085dcfd871b56fb4cf582620260b70caa07a | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-09-25T21:22:08.000Z | 2021-08-30T20:06:18.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 37.313901 | 134 | 0.619277 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
__all__ = ['TeamsArgs', 'Teams']
@pulumi.input_type
class TeamsArgs:
def __init__(__self__, *,
org_id: pulumi.Input[str],
username... | true | true |
f70ef76b75487b358e5b02d032d6a1bf46a704d9 | 3,741 | py | Python | faker/providers/lorem/hy_AM/__init__.py | tristanHdez18/faker | 14cb25712e6efcb7bf8d9f30f404a7304722af6d | [
"MIT"
] | 1 | 2022-02-16T23:14:19.000Z | 2022-02-16T23:14:19.000Z | faker/providers/lorem/hy_AM/__init__.py | tristanHdez18/faker | 14cb25712e6efcb7bf8d9f30f404a7304722af6d | [
"MIT"
] | 33 | 2020-12-09T16:49:15.000Z | 2022-01-04T22:03:10.000Z | faker/providers/lorem/hy_AM/__init__.py | tristanHdez18/faker | 14cb25712e6efcb7bf8d9f30f404a7304722af6d | [
"MIT"
] | 3 | 2022-02-07T18:18:54.000Z | 2022-03-11T22:09:01.000Z | from .. import Provider as LoremProvider
class Provider(LoremProvider):
"""Implement lorem provider for ``hy_AM`` locale.
Sources:
- https://www.101languages.net/armenian/armenian-word-list
"""
word_list = (
"ես",
"դու",
"նա",
"մենք",
"դուք",
"նրա... | 16.480176 | 62 | 0.295108 | from .. import Provider as LoremProvider
class Provider(LoremProvider):
word_list = (
"ես",
"դու",
"նա",
"մենք",
"դուք",
"նրանք",
"այս",
"այն",
"այստեղ",
"այնտեղ",
"ով",
"ինչ",
"որտեղ",
"ուր",
... | true | true |
f70ef7f591cfdde370c54c465c9581237183a58d | 6,238 | py | Python | src/_pytest/skipping.py | rosemichaele/pytest | 1c0ab3c2a32f7932378a1c37106d082784cb4700 | [
"MIT"
] | 3 | 2019-11-26T02:30:12.000Z | 2020-04-15T17:49:07.000Z | src/_pytest/skipping.py | rosemichaele/pytest | 1c0ab3c2a32f7932378a1c37106d082784cb4700 | [
"MIT"
] | 59 | 2019-10-22T04:34:22.000Z | 2021-11-27T18:23:11.000Z | src/_pytest/skipping.py | rosemichaele/pytest | 1c0ab3c2a32f7932378a1c37106d082784cb4700 | [
"MIT"
] | 17 | 2019-11-21T14:11:29.000Z | 2019-11-21T15:26:23.000Z | """ support for skip/xfail functions and markers. """
from _pytest.config import hookimpl
from _pytest.mark.evaluate import MarkEvaluator
from _pytest.outcomes import fail
from _pytest.outcomes import skip
from _pytest.outcomes import xfail
def pytest_addoption(parser):
group = parser.getgroup("general")
grou... | 35.044944 | 87 | 0.639147 | from _pytest.config import hookimpl
from _pytest.mark.evaluate import MarkEvaluator
from _pytest.outcomes import fail
from _pytest.outcomes import skip
from _pytest.outcomes import xfail
def pytest_addoption(parser):
group = parser.getgroup("general")
group.addoption(
"--runxfail",
action="sto... | true | true |
f70ef8dc5d4a4a748215573850421d4fa74c60d1 | 3,661 | py | Python | generate_embeddings.py | Amitdedhia6/DrugDiscovery | c70dec96cee4d0d643a8b9de30530b6871fdf05e | [
"Apache-2.0"
] | null | null | null | generate_embeddings.py | Amitdedhia6/DrugDiscovery | c70dec96cee4d0d643a8b9de30530b6871fdf05e | [
"Apache-2.0"
] | null | null | null | generate_embeddings.py | Amitdedhia6/DrugDiscovery | c70dec96cee4d0d643a8b9de30530b6871fdf05e | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import os
from common import base_data_path
from typing import List
import pandas as pd
CONTEXT_SIZE = 1 # 1 words to the left, 1 to the right
EMDEDDING_DIM = 3
word_to_ix = {}
ix_to_word = {}
def make_context_vector(context, word_to_ix):
idxs = [word_to_ix[w] for w in contex... | 29.055556 | 111 | 0.659383 | import torch
import torch.nn as nn
import os
from common import base_data_path
from typing import List
import pandas as pd
CONTEXT_SIZE = 1
EMDEDDING_DIM = 3
word_to_ix = {}
ix_to_word = {}
def make_context_vector(context, word_to_ix):
idxs = [word_to_ix[w] for w in context]
return torch.tensor(idxs, dtyp... | true | true |
f70ef90f5e9f2e939fd227f2c3e143a931c5319a | 5,947 | py | Python | scripts/functionality/solarsystem.py | Whykiller/Final_Project-Python_Class | 29cb388883e19476efe6d96803075b72b79a5aff | [
"MIT"
] | null | null | null | scripts/functionality/solarsystem.py | Whykiller/Final_Project-Python_Class | 29cb388883e19476efe6d96803075b72b79a5aff | [
"MIT"
] | 8 | 2020-06-20T16:53:26.000Z | 2020-06-26T13:08:53.000Z | scripts/functionality/solarsystem.py | Whykiller/Fortgeschrittener_Python_Kurs | 29cb388883e19476efe6d96803075b72b79a5aff | [
"MIT"
] | 1 | 2021-07-19T17:40:11.000Z | 2021-07-19T17:40:11.000Z | import functionality.planets as planets
import assets.tools as tools
from assets.variables import *
# TODO: Also add logger to code and display errors correctly
# TODO: Make one pixel correspond to 1/10 au so that acceleration works more realistic
class SolarSystem(metaclass=tools.Singleton):
"""This creates the... | 28.868932 | 114 | 0.599798 | import functionality.planets as planets
import assets.tools as tools
from assets.variables import *
class SolarSystem(metaclass=tools.Singleton):
def __init__(self) -> None:
self.planets_list = []
self.max_objects = 10
self.system_time = 0
self.error = False
def... | true | true |
f70efa147c6f9c7ee90e557fe0740d068a1ce522 | 213 | py | Python | tests/test_ai.py | divanorama/katrain | dc22aa88526fb6446f908259f06020d649a2d0a9 | [
"MIT"
] | null | null | null | tests/test_ai.py | divanorama/katrain | dc22aa88526fb6446f908259f06020d649a2d0a9 | [
"MIT"
] | null | null | null | tests/test_ai.py | divanorama/katrain | dc22aa88526fb6446f908259f06020d649a2d0a9 | [
"MIT"
] | null | null | null | import pytest
from katrain.core.constants import AI_STRATEGIES_RECOMMENDED_ORDER, AI_STRATEGIES
class TestAI:
def test_order(self):
assert set(AI_STRATEGIES_RECOMMENDED_ORDER) == set(AI_STRATEGIES)
| 23.666667 | 81 | 0.798122 | import pytest
from katrain.core.constants import AI_STRATEGIES_RECOMMENDED_ORDER, AI_STRATEGIES
class TestAI:
def test_order(self):
assert set(AI_STRATEGIES_RECOMMENDED_ORDER) == set(AI_STRATEGIES)
| true | true |
f70efd874fd49a156b8dd23f6d6d90fc73d34d8f | 1,341 | py | Python | matterapi/enums.py | gmerz/MatterApi | b116da58d3a4ca77739970a28e30672e0e611705 | [
"MIT"
] | 3 | 2022-01-26T23:31:01.000Z | 2022-03-01T13:07:26.000Z | matterapi/enums.py | gmerz/MatterApi | b116da58d3a4ca77739970a28e30672e0e611705 | [
"MIT"
] | null | null | null | matterapi/enums.py | gmerz/MatterApi | b116da58d3a4ca77739970a28e30672e0e611705 | [
"MIT"
] | null | null | null | """ Enums used in different API endpoints """
from enum import Enum
class PluginStatusState(str, Enum):
"""State of the plugin"""
NOTRUNNING = "NotRunning"
STARTING = "Starting"
RUNNING = "Running"
FAILEDTOSTART = "FailedToStart"
FAILEDTOSTAYRUNNING = "FailedToStayRunning"
STOPPING = "Sto... | 21.285714 | 61 | 0.645041 | from enum import Enum
class PluginStatusState(str, Enum):
NOTRUNNING = "NotRunning"
STARTING = "Starting"
RUNNING = "Running"
FAILEDTOSTART = "FailedToStart"
FAILEDTOSTAYRUNNING = "FailedToStayRunning"
STOPPING = "Stopping"
def __str__(self) -> str:
return str(self.value)
class... | true | true |
f70efda32ce2d0e30af7d589d3a939cff26d40b4 | 5,492 | py | Python | heuristic/train/nn/train-nn.py | ehsanul/brick | 291c0783f3b062cf73887cb3581dd92342891165 | [
"MIT"
] | 5 | 2018-06-08T01:32:26.000Z | 2019-05-14T15:30:02.000Z | heuristic/train/nn/train-nn.py | ehsanul/brick | 291c0783f3b062cf73887cb3581dd92342891165 | [
"MIT"
] | 1 | 2018-07-16T11:52:30.000Z | 2018-07-25T06:51:10.000Z | heuristic/train/nn/train-nn.py | ehsanul/brick | 291c0783f3b062cf73887cb3581dd92342891165 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
import sys
import pathlib
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
EPOCHS = 1000
# The patience parameter is the amount of epoch... | 33.901235 | 151 | 0.682629 | from __future__ import absolute_import, division, print_function
import sys
import pathlib
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
EPOCHS = 1000
EARLY_STOP = keras.callbacks.EarlyStopping(mon... | true | true |
f70efeb1edf8afda9c8ef1c5b5a73e8cf2c23017 | 1,514 | py | Python | pirate_control/python-rtmidi-0.3.1a/tests/test_probe_ports.py | bopopescu/pco-pirate | b8836870254992b4cb316fe29805e914a6e9910f | [
"MIT"
] | 1 | 2019-12-27T11:45:11.000Z | 2019-12-27T11:45:11.000Z | pirate_control/python-rtmidi-0.3.1a/tests/test_probe_ports.py | bopopescu/pco-pirate | b8836870254992b4cb316fe29805e914a6e9910f | [
"MIT"
] | 1 | 2020-07-24T15:59:56.000Z | 2020-07-24T15:59:56.000Z | pirate_control/python-rtmidi-0.3.1a/tests/test_probe_ports.py | bopopescu/pco-pirate | b8836870254992b4cb316fe29805e914a6e9910f | [
"MIT"
] | 1 | 2020-07-24T12:54:33.000Z | 2020-07-24T12:54:33.000Z | #!/usr/bin/env python
#
# test_probe_ports.py
#
"""Shows how to probe for available MIDI input and output ports."""
import sys
from rtmidi import *
try:
raw_input
except NameError:
# Python 3
raw_input = input
apis = {
API_MACOSX_CORE: "OS X CoreMIDI",
API_LINUX_ALSA: "Linux ALSA",
API_UNIX_JAC... | 26.561404 | 80 | 0.543593 |
import sys
from rtmidi import *
try:
raw_input
except NameError:
raw_input = input
apis = {
API_MACOSX_CORE: "OS X CoreMIDI",
API_LINUX_ALSA: "Linux ALSA",
API_UNIX_JACK: "Jack Client",
API_WINDOWS_MM: "Windows MultiMedia",
API_WINDOWS_KS: "Windows Kernel Streaming",
API_RTMID... | true | true |
f70eff5e37149022cec92c5d324368e5cbb343fc | 4,569 | py | Python | web3tools/web3wallet.py | LinuxIsCool/tokenspice2 | aeca439b4beb1462e1f988f5d8eac60c2c5e8cbf | [
"Apache-2.0"
] | null | null | null | web3tools/web3wallet.py | LinuxIsCool/tokenspice2 | aeca439b4beb1462e1f988f5d8eac60c2c5e8cbf | [
"Apache-2.0"
] | null | null | null | web3tools/web3wallet.py | LinuxIsCool/tokenspice2 | aeca439b4beb1462e1f988f5d8eac60c2c5e8cbf | [
"Apache-2.0"
] | 1 | 2021-09-05T22:34:29.000Z | 2021-09-05T22:34:29.000Z | import logging
import typing
import web3
from util import constants
from web3tools import web3util, account
logger = logging.getLogger(__name__)
def randomWeb3Wallet():
private_key = account.randomPrivateKey()
return Web3Wallet(private_key=private_key)
class Web3Wallet:
"""Signs txs and msgs with an acc... | 33.595588 | 93 | 0.663821 | import logging
import typing
import web3
from util import constants
from web3tools import web3util, account
logger = logging.getLogger(__name__)
def randomWeb3Wallet():
private_key = account.randomPrivateKey()
return Web3Wallet(private_key=private_key)
class Web3Wallet:
_last_tx_count = dict()
MIN_G... | true | true |
f70efff899fc1223c7b3fa5193ad0a13d4e23777 | 34,673 | py | Python | aiohttp/client_reqrep.py | loven-doo/aiohttp | 01ef966b261bc6a8934b3c53c79c92f019b404a7 | [
"Apache-2.0"
] | 2 | 2021-02-04T10:49:55.000Z | 2021-02-04T10:50:31.000Z | aiohttp/client_reqrep.py | loven-doo/aiohttp | 01ef966b261bc6a8934b3c53c79c92f019b404a7 | [
"Apache-2.0"
] | 228 | 2020-10-17T22:31:34.000Z | 2022-03-28T18:13:31.000Z | aiohttp/client_reqrep.py | loven-doo/aiohttp | 01ef966b261bc6a8934b3c53c79c92f019b404a7 | [
"Apache-2.0"
] | 1 | 2021-07-22T04:21:08.000Z | 2021-07-22T04:21:08.000Z | import asyncio
import codecs
import dataclasses
import functools
import io
import re
import sys
import traceback
import warnings
from hashlib import md5, sha1, sha256
from http.cookies import CookieError, Morsel, SimpleCookie
from types import MappingProxyType, TracebackType
from typing import (
TYPE_CHECKING,
... | 32.618062 | 88 | 0.582124 | import asyncio
import codecs
import dataclasses
import functools
import io
import re
import sys
import traceback
import warnings
from hashlib import md5, sha1, sha256
from http.cookies import CookieError, Morsel, SimpleCookie
from types import MappingProxyType, TracebackType
from typing import (
TYPE_CHECKING,
... | true | true |
f70f0001824e96892d2caeddbb3fede6f0d4c87a | 95 | py | Python | file/admin.py | simonprast/bestconnect-backend | fa19998e72941454c8f99246e37ba3d1810f3010 | [
"BSD-Source-Code"
] | null | null | null | file/admin.py | simonprast/bestconnect-backend | fa19998e72941454c8f99246e37ba3d1810f3010 | [
"BSD-Source-Code"
] | 2 | 2022-01-07T07:27:21.000Z | 2022-01-07T08:34:54.000Z | file/admin.py | simonprast/django-entrypoint | b32377dea0f367be598bc851bc0fdacc2b74a496 | [
"CNRI-Python"
] | null | null | null | from django.contrib import admin
from .models import Document
admin.site.register(Document)
| 13.571429 | 32 | 0.810526 | from django.contrib import admin
from .models import Document
admin.site.register(Document)
| true | true |
f70f000a0c7c5ab0c91dcb60e9125ca81979a3b3 | 112 | py | Python | python/reportlab/rml2pdf.py | trammell/test | ccac5e1dac947032e64d813e53cb961417a58d05 | [
"Artistic-2.0"
] | null | null | null | python/reportlab/rml2pdf.py | trammell/test | ccac5e1dac947032e64d813e53cb961417a58d05 | [
"Artistic-2.0"
] | null | null | null | python/reportlab/rml2pdf.py | trammell/test | ccac5e1dac947032e64d813e53cb961417a58d05 | [
"Artistic-2.0"
] | null | null | null | #!/usr/bin/env python2.4
import sys
from z3c.rml import rml2pdf
for arg in sys.argv[1:]:
rml2pdf.go(arg)
| 12.444444 | 27 | 0.6875 |
import sys
from z3c.rml import rml2pdf
for arg in sys.argv[1:]:
rml2pdf.go(arg)
| true | true |
f70f001340f4fac68545626ee014b6ff5aef8fbd | 228 | py | Python | backend/cost_claimer/admin.py | Trevor-Mansfield/WalmartReceiptSplitter | db85eef9210f177eaa298969ba64ff916d4a9b27 | [
"MIT"
] | null | null | null | backend/cost_claimer/admin.py | Trevor-Mansfield/WalmartReceiptSplitter | db85eef9210f177eaa298969ba64ff916d4a9b27 | [
"MIT"
] | 1 | 2020-11-01T01:54:42.000Z | 2020-11-01T01:54:42.000Z | backend/cost_claimer/admin.py | Trevor-Mansfield/WalmartReceiptSplitter | db85eef9210f177eaa298969ba64ff916d4a9b27 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Receipt, Item, User, Cover, Payment
admin.site.register(Receipt)
admin.site.register(Item)
admin.site.register(User)
admin.site.register(Cover)
admin.site.register(Payment)
| 22.8 | 55 | 0.802632 | from django.contrib import admin
from .models import Receipt, Item, User, Cover, Payment
admin.site.register(Receipt)
admin.site.register(Item)
admin.site.register(User)
admin.site.register(Cover)
admin.site.register(Payment)
| true | true |
f70f00182433c7a822fe1637de1c29153c5dcf36 | 820 | py | Python | docs/conf.py | hat-open/hat-stc | 8edf9e23f9f2d8e581f844f96e7a38d02ef4f403 | [
"Apache-2.0"
] | 1 | 2022-02-01T13:42:25.000Z | 2022-02-01T13:42:25.000Z | docs/conf.py | hat-open/hat-stc | 8edf9e23f9f2d8e581f844f96e7a38d02ef4f403 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | hat-open/hat-stc | 8edf9e23f9f2d8e581f844f96e7a38d02ef4f403 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import subprocess
root_path = Path(__file__).parent.parent.resolve()
extensions = [
'sphinx.ext.todo',
'sphinxcontrib.drawio',
]
version = (root_path / 'VERSION').read_text().strip()
project = 'hat-stc'
copyright = '2020-2021, Hat Open AUTHORS'
master_doc = 'index'
html_theme = 'fu... | 25.625 | 72 | 0.664634 | from pathlib import Path
import subprocess
root_path = Path(__file__).parent.parent.resolve()
extensions = [
'sphinx.ext.todo',
'sphinxcontrib.drawio',
]
version = (root_path / 'VERSION').read_text().strip()
project = 'hat-stc'
copyright = '2020-2021, Hat Open AUTHORS'
master_doc = 'index'
html_theme = 'fu... | true | true |
f70f010c765e7d5b11c81cbf2a8a5f6563f97562 | 1,657 | py | Python | pyrasterframes/python/geomesa_pyspark/types.py | jdenisgiguere/rasterframes | 4226cde5223e67ab0e9f27c98bc1053d0a4b7a4e | [
"Apache-2.0"
] | null | null | null | pyrasterframes/python/geomesa_pyspark/types.py | jdenisgiguere/rasterframes | 4226cde5223e67ab0e9f27c98bc1053d0a4b7a4e | [
"Apache-2.0"
] | null | null | null | pyrasterframes/python/geomesa_pyspark/types.py | jdenisgiguere/rasterframes | 4226cde5223e67ab0e9f27c98bc1053d0a4b7a4e | [
"Apache-2.0"
] | null | null | null | """***********************************************************************
This file was created by Astraea, Inc., 2018 from an excerpt of the
original:
Copyright (c) 2013-2018 Commonwealth Computer Research, Inc.
All rights reserved. This program and the accompanying materials
are made available under ... | 24.014493 | 77 | 0.652384 |
from pyspark.sql.types import UserDefinedType
from pyspark.sql import Row
from pyspark.sql.types import *
from pyrasterframes.context import RFContext
class GeometryUDT(UserDefinedType):
@classmethod
def sqlType(self):
return StructType([StructField("wkb", BinaryType(), True)])
@classmet... | true | true |
f70f016add7378486fc5701457b5b6ce3da7e9e2 | 3,181 | py | Python | moog/action_spaces/joystick.py | juanpablordz/moog.github.io | d7995d3563492378d0877ce8d16f5ca9a8031794 | [
"Apache-2.0",
"MIT"
] | 22 | 2021-02-26T18:19:35.000Z | 2022-03-05T19:01:00.000Z | moog/action_spaces/joystick.py | juanpablordz/moog.github.io | d7995d3563492378d0877ce8d16f5ca9a8031794 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-04-01T06:15:02.000Z | 2021-04-23T13:14:12.000Z | moog/action_spaces/joystick.py | juanpablordz/moog.github.io | d7995d3563492378d0877ce8d16f5ca9a8031794 | [
"Apache-2.0",
"MIT"
] | 2 | 2021-05-02T02:20:39.000Z | 2021-05-06T16:24:35.000Z | """Joystick action space for controlling agent avatars."""
from . import abstract_action_space
from dm_env import specs
import numpy as np
class Joystick(abstract_action_space.AbstractActionSpace):
"""Joystick action space."""
def __init__(self, scaling_factor=1., action_layers='agent',
con... | 40.782051 | 80 | 0.617102 |
from . import abstract_action_space
from dm_env import specs
import numpy as np
class Joystick(abstract_action_space.AbstractActionSpace):
def __init__(self, scaling_factor=1., action_layers='agent',
constrained_lr=False, control_velocity=False, momentum=0.):
self._scaling_factor = scal... | true | true |
f70f0196bf302980bb4ad2f3eb39b8628d0c4555 | 5,380 | py | Python | tests/test_data.py | pedromachados/pygeocodio | 5ff11edd46e749a9236078f9a207cdf501b08b58 | [
"BSD-3-Clause"
] | null | null | null | tests/test_data.py | pedromachados/pygeocodio | 5ff11edd46e749a9236078f9a207cdf501b08b58 | [
"BSD-3-Clause"
] | null | null | null | tests/test_data.py | pedromachados/pygeocodio | 5ff11edd46e749a9236078f9a207cdf501b08b58 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_geocodio
----------------------------------
Tests for `geocodio.data` module.
"""
import json
import os
import unittest
from geocodio.data import Address
from geocodio.data import Location
from geocodio.data import LocationCollection
class TestDataTypes(unitt... | 37.361111 | 88 | 0.631227 |
import json
import os
import unittest
from geocodio.data import Address
from geocodio.data import Location
from geocodio.data import LocationCollection
class TestDataTypes(unittest.TestCase):
def setUp(self):
fixtures = os.path.join(os.path.dirname(os.path.abspath(__file__)), "response/")
wi... | true | true |
f70f020b7929b4915c2fffab4ea28ab2f15b1866 | 11,795 | py | Python | docs/source/conf.py | nkeilbart/aiida-nwchem | d5199b8a94fc2ec8ed30d3370ceac3826312b757 | [
"MIT"
] | 1 | 2019-12-12T15:54:58.000Z | 2019-12-12T15:54:58.000Z | docs/source/conf.py | nkeilbart/aiida-nwchem | d5199b8a94fc2ec8ed30d3370ceac3826312b757 | [
"MIT"
] | 10 | 2017-11-16T15:53:39.000Z | 2021-12-07T16:34:18.000Z | docs/source/conf.py | nkeilbart/aiida-nwchem | d5199b8a94fc2ec8ed30d3370ceac3826312b757 | [
"MIT"
] | 6 | 2018-08-14T13:26:30.000Z | 2021-12-31T14:37:31.000Z | # -*- coding: utf-8 -*-
#
# Sphinx configuration
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show t... | 33.039216 | 116 | 0.701145 |
import os
import sys
import time
import aiida_nwchem
from aiida.manage.configuration import load_documentation_profile
load_documentation_profile()
if not os.environ.get('READTHEDOCS', None):
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get... | true | true |
f70f028521e5de5b0a466d4f2b82c44f85164074 | 769 | py | Python | final_project/server.py | jozuk/xzceb-flask_eng_fr | c5c89f9662c112698582a798560a97efec98993b | [
"Apache-2.0"
] | null | null | null | final_project/server.py | jozuk/xzceb-flask_eng_fr | c5c89f9662c112698582a798560a97efec98993b | [
"Apache-2.0"
] | null | null | null | final_project/server.py | jozuk/xzceb-flask_eng_fr | c5c89f9662c112698582a798560a97efec98993b | [
"Apache-2.0"
] | null | null | null | from machinetranslation import translator
from flask import Flask, render_template, request
import json
app = Flask("Web Translator")
@app.route("/englishToFrench")
def englishToFrench():
textToTranslate = request.args.get('textToTranslate')
translation = translator.englishToFrench(englishText=textToTranslate... | 30.76 | 73 | 0.755527 | from machinetranslation import translator
from flask import Flask, render_template, request
import json
app = Flask("Web Translator")
@app.route("/englishToFrench")
def englishToFrench():
textToTranslate = request.args.get('textToTranslate')
translation = translator.englishToFrench(englishText=textToTranslate... | true | true |
f70f035e63d0185dcc7a6309281b612f988cd503 | 3,602 | py | Python | bindings/python/ensmallen/datasets/string/lachnospiraceaebacteriumnk4a144.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/lachnospiraceaebacteriumnk4a144.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/lachnospiraceaebacteriumnk4a144.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Lachnospiraceae bacterium NK4A144.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: prote... | 33.351852 | 223 | 0.681566 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def LachnospiraceaeBacteriumNk4a144(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "... | true | true |
f70f03937dd486d609695c5a1f3d24ea0a9fafa6 | 2,141 | py | Python | tools/Vitis-AI-Library/xmodel_image/models/efficientNet-edgetpu-S/efficientNet-edgetpu-S.py | bluetiger9/Vitis-AI | a7728733bbcfc292ff3afa46b9c8b03e94b740b3 | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tools/Vitis-AI-Library/xmodel_image/models/efficientNet-edgetpu-S/efficientNet-edgetpu-S.py | wangyifan778/Vitis-AI | f61061eef7550d98bf02a171604c9a9f283a7c47 | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tools/Vitis-AI-Library/xmodel_image/models/efficientNet-edgetpu-S/efficientNet-edgetpu-S.py | wangyifan778/Vitis-AI | f61061eef7550d98bf02a171604c9a9f283a7c47 | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | #
# Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 46.543478 | 117 | 0.685194 |
import os
import xir_extra_ops
def jit(graph):
graph.set_attr("xmodel_preprocessor", "libxmodel_preprocessor_efficientnet.so.1")
graph.set_attr("need_preprocess", True)
graph.set_attr("mean", [127.0, 127.0, 127.0])
graph.set_attr("scale", [0.0078125, 0.0078125, 0.0078125])
graph.set_... | true | true |
f70f040ea176c1df0334a1bc712c28b2bf4eae04 | 845 | py | Python | plugins/recreations/plugins/nonebot_plugin_picsearcher/formdata.py | liangzimiao/miyubot | c2788712255e39348c8980c8ace2f6f75fb6621c | [
"Apache-2.0"
] | null | null | null | plugins/recreations/plugins/nonebot_plugin_picsearcher/formdata.py | liangzimiao/miyubot | c2788712255e39348c8980c8ace2f6f75fb6621c | [
"Apache-2.0"
] | null | null | null | plugins/recreations/plugins/nonebot_plugin_picsearcher/formdata.py | liangzimiao/miyubot | c2788712255e39348c8980c8ace2f6f75fb6621c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from typing import Any, Iterable, List, Optional
from aiohttp import FormData as _FormData
import aiohttp.multipart as multipart
class FormData(_FormData):
def __init__(
self,
fields: Iterable[Any] = (),
quote_fields: bool = True,
charset: Optional[str] = N... | 30.178571 | 80 | 0.616568 |
from typing import Any, Iterable, List, Optional
from aiohttp import FormData as _FormData
import aiohttp.multipart as multipart
class FormData(_FormData):
def __init__(
self,
fields: Iterable[Any] = (),
quote_fields: bool = True,
charset: Optional[str] = None,
boundary: ... | true | true |
f70f053b6cba750dfb3d76ebc766809958971f63 | 10,714 | py | Python | site_scons/podd_util.py | leadmocha/analyzer | ab26d755dbe816975e4165479c9fbefc4c4ca069 | [
"BSD-3-Clause"
] | null | null | null | site_scons/podd_util.py | leadmocha/analyzer | ab26d755dbe816975e4165479c9fbefc4c4ca069 | [
"BSD-3-Clause"
] | null | null | null | site_scons/podd_util.py | leadmocha/analyzer | ab26d755dbe816975e4165479c9fbefc4c4ca069 | [
"BSD-3-Clause"
] | null | null | null | # podd_utils.py
# Utility functions for Podd SCons build
import os
from SCons.Action import ActionFactory
from SCons.Script.SConscript import SConsEnvironment
SConsEnvironment.OSCommand = ActionFactory(os.system,
lambda command : 'os.system("%s")' % command)
import SCons.Util
def list_to_path(lst):
... | 39.389706 | 91 | 0.612936 |
import os
from SCons.Action import ActionFactory
from SCons.Script.SConscript import SConsEnvironment
SConsEnvironment.OSCommand = ActionFactory(os.system,
lambda command : 'os.system("%s")' % command)
import SCons.Util
def list_to_path(lst):
result = ''
if SCons.Util.is_List(lst):
for... | true | true |
f70f0585c7ebf9f69ae33d24a7e5ee609fe1149b | 7,087 | py | Python | Code/VnetLA/validate.py | yyliu01/TraCoCo | eecbc92c961d393deaa31726739a94b7f495d893 | [
"MIT"
] | 4 | 2022-03-29T04:19:02.000Z | 2022-03-31T07:48:24.000Z | Code/VnetLA/validate.py | yyliu01/TraCoCo | eecbc92c961d393deaa31726739a94b7f495d893 | [
"MIT"
] | null | null | null | Code/VnetLA/validate.py | yyliu01/TraCoCo | eecbc92c961d393deaa31726739a94b7f495d893 | [
"MIT"
] | null | null | null | import os
import math
import torch
import argparse
import numpy as np
from tqdm import tqdm
from medpy import metric
import torch.nn.functional as F
from Configs.config import config
from Model.Vnet import VNet as Vnet
from cc3d import connected_components
from Dataloader.dataset import LAHeartDataset
"""
# https://gi... | 39.372222 | 107 | 0.597291 | import os
import math
import torch
import argparse
import numpy as np
from tqdm import tqdm
from medpy import metric
import torch.nn.functional as F
from Configs.config import config
from Model.Vnet import VNet as Vnet
from cc3d import connected_components
from Dataloader.dataset import LAHeartDataset
def cct(pseudo... | true | true |
f70f05ab41aae7df827738907b865086531ef156 | 15,255 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20170301/load_balancer.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20170301/load_balancer.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20170301/load_balancer.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 63.5625 | 2,495 | 0.708686 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['LoadBalancer']
class LoadBalancer(pulumi.CustomResource):
def __init__(__self__,
... | true | true |
f70f06341c00091fa3e07ab8cacd2d2f5aa1ebc3 | 19,241 | py | Python | airmozilla/search/views.py | mozilla/airmozilla | fa6acbbbacc1e22553457807bcea7ce7a9ef6fe3 | [
"BSD-3-Clause"
] | 115 | 2015-01-06T18:45:39.000Z | 2022-02-07T10:56:49.000Z | airmozilla/search/views.py | april/airmozilla | ee357f5396cdcb50147c72ff1e81a610f9cb292c | [
"BSD-3-Clause"
] | 321 | 2015-01-02T15:19:25.000Z | 2018-07-05T14:58:50.000Z | airmozilla/search/views.py | april/airmozilla | ee357f5396cdcb50147c72ff1e81a610f9cb292c | [
"BSD-3-Clause"
] | 101 | 2015-01-13T17:59:15.000Z | 2020-12-15T02:58:38.000Z | import re
import urllib
import time
from django.shortcuts import render, redirect, get_object_or_404
from django import http
from django.db.utils import DatabaseError
from django.db import transaction
from django.db.models import Count
from django.conf import settings
from django.core.urlresolvers import reverse
from ... | 32.611864 | 78 | 0.551427 | import re
import urllib
import time
from django.shortcuts import render, redirect, get_object_or_404
from django import http
from django.db.utils import DatabaseError
from django.db import transaction
from django.db.models import Count
from django.conf import settings
from django.core.urlresolvers import reverse
from ... | true | true |
f70f069823fd5ef6630117d9dc3a0f6b3c733dac | 6,184 | py | Python | aspect_sentiment.py | dcstrandberg/aspect-sentiment | 0177888d4fe96d49b78e44f5bd24be619c93bf00 | [
"MIT"
] | null | null | null | aspect_sentiment.py | dcstrandberg/aspect-sentiment | 0177888d4fe96d49b78e44f5bd24be619c93bf00 | [
"MIT"
] | null | null | null | aspect_sentiment.py | dcstrandberg/aspect-sentiment | 0177888d4fe96d49b78e44f5bd24be619c93bf00 | [
"MIT"
] | null | null | null | import spacy
from textblob import TextBlob
import pandas as pd
# Import functions from other files
from tweet_handlers import pullTweetsFromCSV, tweetPulls
### Declare functions to standardize, identify, and analyze input text
# Will ultimately take in a list of tweets and return:
# - Word counts
# - Split of positiv... | 35.54023 | 159 | 0.656856 | import spacy
from textblob import TextBlob
import pandas as pd
from tweet_handlers import pullTweetsFromCSV, tweetPulls
ath = './' + writeFilename + '.html'
with open(filePath, 'w') as f:
f.write(html)
return filePath
def extractDescriptors(nlp, sentenceList):
aspects = []
... | true | true |
f70f0787a0e23d8cb0acd7856c1396ee2bb4208f | 61,694 | py | Python | utils.py | williamhowardsnyder/OnClass | 07b2917dbdf01a1de54771de3383bbaa4bb2f283 | [
"MIT"
] | 33 | 2019-10-22T17:46:21.000Z | 2022-01-31T15:38:54.000Z | utils.py | williamhowardsnyder/OnClass | 07b2917dbdf01a1de54771de3383bbaa4bb2f283 | [
"MIT"
] | 9 | 2019-11-20T21:58:49.000Z | 2022-03-24T17:32:18.000Z | utils.py | williamhowardsnyder/OnClass | 07b2917dbdf01a1de54771de3383bbaa4bb2f283 | [
"MIT"
] | 11 | 2019-10-30T22:42:53.000Z | 2022-03-16T06:35:37.000Z | from anndata import read_h5ad
import sys
from time import time
from scipy import stats, sparse
import numpy as np
import collections
import pickle
from sklearn.preprocessing import normalize
import os
from collections import Counter
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.m... | 34.64009 | 336 | 0.705903 | from anndata import read_h5ad
import sys
from time import time
from scipy import stats, sparse
import numpy as np
import collections
import pickle
from sklearn.preprocessing import normalize
import os
from collections import Counter
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.m... | true | true |
f70f08db465afe069cfaa7e1cf2eaa71195adbb9 | 8,661 | py | Python | Offline/dataset.py | HongLabTHU/dual-mVEPs | f387584865a45a7257d8203fcb9522820e1311de | [
"Apache-2.0"
] | 7 | 2019-11-29T07:16:55.000Z | 2021-12-21T02:13:26.000Z | Offline/dataset.py | HongLabTHU/dual-mVEPs | f387584865a45a7257d8203fcb9522820e1311de | [
"Apache-2.0"
] | null | null | null | Offline/dataset.py | HongLabTHU/dual-mVEPs | f387584865a45a7257d8203fcb9522820e1311de | [
"Apache-2.0"
] | 4 | 2020-04-28T08:02:44.000Z | 2021-12-21T02:13:27.000Z | import glob
import os
import warnings
from datetime import datetime
from copy import deepcopy
import numpy as np
import pyedflib
import scipy.io as sio
from config import cfg
from thirdparty.cerebus import NsxFile, NevFile
from thirdparty.nex import Reader as NexReader
from .utils import find_nearest_time
def _load... | 32.317164 | 120 | 0.607551 | import glob
import os
import warnings
from datetime import datetime
from copy import deepcopy
import numpy as np
import pyedflib
import scipy.io as sio
from config import cfg
from thirdparty.cerebus import NsxFile, NevFile
from thirdparty.nex import Reader as NexReader
from .utils import find_nearest_time
def _load... | true | true |
f70f091487d65dd2f5ff52861bbd8b9a57e1dcd8 | 1,719 | py | Python | tools/bitesize.py | jerr/bcc | f3fc87aab83ce3e4f1ca227e33853df21147255a | [
"Apache-2.0"
] | 5 | 2018-11-01T12:17:32.000Z | 2021-06-14T10:56:53.000Z | tools/bitesize.py | gdankel/bcc | 2cc96a8c17b9b7059883627ea211f30a77061b2b | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2018-02-09T22:24:29.000Z | 2018-06-18T22:33:29.000Z | tools/bitesize.py | gdankel/bcc | 2cc96a8c17b9b7059883627ea211f30a77061b2b | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2018-01-31T05:04:19.000Z | 2018-06-12T00:45:21.000Z | #!/usr/bin/python
#
# bitehist.py Block I/O size histogram.
# For Linux, uses BCC, eBPF. See .c file.
#
# USAGE: bitesize
#
# Ctrl-C will print the partially gathered histogram then exit.
#
# Copyright (c) 2016 Allan McAleavy
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 05-Feb-20... | 22.324675 | 76 | 0.670157 |
from bcc import BPF
from time import sleep
bpf_text = """
#include <uapi/linux/ptrace.h>
#include <linux/blkdev.h>
struct proc_key_t {
char name[TASK_COMM_LEN];
u64 slot;
};
struct val_t {
char name[TASK_COMM_LEN];
};
BPF_HISTOGRAM(dist, struct proc_key_t);
BPF_HASH(commbyreq, struct reque... | true | true |
f70f0b4b935ab084e2e02ffe3c58b6c6932fdad3 | 1,115 | py | Python | train/model_stack.py | pabloserna/SentimentAnalysisinAWS | d94572665442ef6f49deb07ed78f8104654fefc3 | [
"MIT"
] | null | null | null | train/model_stack.py | pabloserna/SentimentAnalysisinAWS | d94572665442ef6f49deb07ed78f8104654fefc3 | [
"MIT"
] | null | null | null | train/model_stack.py | pabloserna/SentimentAnalysisinAWS | d94572665442ef6f49deb07ed78f8104654fefc3 | [
"MIT"
] | null | null | null | import torch.nn as nn
class LSTMClassifier(nn.Module):
"""
This is the simple RNN model we will be using to perform Sentiment Analysis.
"""
def __init__(self, embedding_dim, hidden_dim, vocab_size):
"""
Initialize the model by settingg up the various layers.
"""
super(L... | 32.794118 | 80 | 0.603587 | import torch.nn as nn
class LSTMClassifier(nn.Module):
def __init__(self, embedding_dim, hidden_dim, vocab_size):
super(LSTMClassifier, self).__init__()
self.embedding = nn.Embedding(vocab_size, embedding_dim, padding_idx=0)
self.lstmA = nn.LSTM(embedding_dim, hidden_dim)
self.lst... | true | true |
f70f0bc03e2af0f6fa2ecb979b20813cc105e3d8 | 4,419 | py | Python | applications/RomApplication/python_scripts/structural_mechanics_analysis_rom.py | KlausBSautter/Kratos | 245b30e38497a242bbdf999278e9c1b6175a573a | [
"BSD-4-Clause"
] | 778 | 2017-01-27T16:29:17.000Z | 2022-03-30T03:01:51.000Z | applications/RomApplication/python_scripts/structural_mechanics_analysis_rom.py | KlausBSautter/Kratos | 245b30e38497a242bbdf999278e9c1b6175a573a | [
"BSD-4-Clause"
] | 6,634 | 2017-01-15T22:56:13.000Z | 2022-03-31T15:03:36.000Z | applications/RomApplication/python_scripts/structural_mechanics_analysis_rom.py | philbucher/Kratos | 1ceb900dbacfab344e27e32285250eafc52093ec | [
"BSD-4-Clause"
] | 224 | 2017-02-07T14:12:49.000Z | 2022-03-06T23:09:34.000Z | import KratosMultiphysics
import KratosMultiphysics.RomApplication as romapp
import KratosMultiphysics.StructuralMechanicsApplication
from KratosMultiphysics.RomApplication.empirical_cubature_method import EmpiricalCubatureMethod
from KratosMultiphysics.RomApplication import python_solvers_wrapper_rom as solver_wrapper... | 53.890244 | 215 | 0.699253 | import KratosMultiphysics
import KratosMultiphysics.RomApplication as romapp
import KratosMultiphysics.StructuralMechanicsApplication
from KratosMultiphysics.RomApplication.empirical_cubature_method import EmpiricalCubatureMethod
from KratosMultiphysics.RomApplication import python_solvers_wrapper_rom as solver_wrapper... | true | true |
f70f0bd663cf1f4669ac616148ad30bc07b5bb89 | 1,491 | py | Python | examples/JoystickButton.py | rwarren/pyqtgraph | e5d28ad79d0fe1c335e7f98a5d9e7ac0b22f0a2b | [
"MIT"
] | null | null | null | examples/JoystickButton.py | rwarren/pyqtgraph | e5d28ad79d0fe1c335e7f98a5d9e7ac0b22f0a2b | [
"MIT"
] | null | null | null | examples/JoystickButton.py | rwarren/pyqtgraph | e5d28ad79d0fe1c335e7f98a5d9e7ac0b22f0a2b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
JoystickButton is a button with x/y values. When the button is depressed and the
mouse dragged, the x/y values change to follow the mouse.
When the mouse button is released, the x/y values change to 0,0 (rather like
letting go of the joystick).
"""
import initExample ## Add path to library... | 25.706897 | 83 | 0.701543 |
import initExample
app = QtGui.QApplication([])
mw = QtGui.QMainWindow()
mw.resize(300,50)
mw.setWindowTitle('pyqtgraph example: JoystickButton')
cw = QtGui.QWidget()
mw.setCentralWidget(cw)
layout = QtGui.QGridLayout()
cw.setLayout(layout)
l1 = pg.ValueLabel(siPrefix=True, suffix='m')
l2 = pg.ValueLabel(siPrefix... | true | true |
f70f0ccfe19d98fa8a0385a18e2bb067db61ce6e | 252 | py | Python | texar/utils/exceptions.py | Holmeswww/Text_Infilling | f63cd24bee5c62d7dedd8fb35c4e52aee20c39f3 | [
"Apache-2.0"
] | 25 | 2019-01-03T09:15:20.000Z | 2022-02-12T04:20:59.000Z | texar/utils/exceptions.py | Holmeswww/Text_Infilling | f63cd24bee5c62d7dedd8fb35c4e52aee20c39f3 | [
"Apache-2.0"
] | 4 | 2019-03-28T11:02:20.000Z | 2022-02-15T04:57:33.000Z | texar/utils/exceptions.py | Holmeswww/Text_Infilling | f63cd24bee5c62d7dedd8fb35c4e52aee20c39f3 | [
"Apache-2.0"
] | 9 | 2019-01-03T02:20:37.000Z | 2022-02-12T04:20:50.000Z | #
"""
Texar defined exceptions.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
__all__ = [
"TexarError"
]
class TexarError(Exception):
"""
Texar error.
"""
pass
| 12 | 38 | 0.690476 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
__all__ = [
"TexarError"
]
class TexarError(Exception):
pass
| true | true |
f70f0db28b86eda5c789b0a6396d94cc6bd56a59 | 1,781 | py | Python | problems/EE/auto/problem149_EE.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 5 | 2020-10-15T14:40:03.000Z | 2021-08-20T17:45:41.000Z | problems/EE/auto/problem149_EE.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | null | null | null | problems/EE/auto/problem149_EE.py | sunandita/ICAPS_Summer_School_RAE_2020 | a496b62185bcfdd2c76eb7986ae99cfa85708d28 | [
"BSD-3-Clause"
] | 2 | 2020-10-15T07:06:14.000Z | 2020-10-15T17:33:01.000Z | __author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... | 29.196721 | 221 | 0.485121 | __author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... | true | true |
f70f0eaeb83c3a6275f22f288f61376329b14e9c | 2,132 | py | Python | google/cloud/managedidentities/v1beta1/managedidentities-v1beta1-py/google/cloud/managedidentities_v1beta1/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/managedidentities/v1/managedidentities-v1-py/google/cloud/managedidentities_v1/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/managedidentities/v1beta1/managedidentities-v1beta1-py/google/cloud/managedidentities_v1beta1/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 38.763636 | 84 | 0.842402 |
from .services.managed_identities_service import ManagedIdentitiesServiceClient
from .services.managed_identities_service import ManagedIdentitiesServiceAsyncClient
from .types.managed_identities_service import AttachTrustRequest
from .types.managed_identities_service import CreateMicrosoftAdDomainRequ... | true | true |
f70f0ef293c12a1c4bf47d9eeda991b5c840f5d7 | 20,689 | py | Python | sr/data_loader.py | sentinel-hub/multi-temporal-super-resolution | 5ef642304a980db87bdb935a7a7450bd649f8912 | [
"MIT"
] | 34 | 2021-05-18T09:04:17.000Z | 2022-02-17T09:34:20.000Z | sr/data_loader.py | kurkutesa/multi-temporal-super-resolution | 5ef642304a980db87bdb935a7a7450bd649f8912 | [
"MIT"
] | 1 | 2021-05-24T13:44:54.000Z | 2021-05-25T13:04:02.000Z | sr/data_loader.py | kurkutesa/multi-temporal-super-resolution | 5ef642304a980db87bdb935a7a7450bd649f8912 | [
"MIT"
] | 4 | 2021-05-25T18:51:57.000Z | 2021-06-28T15:57:21.000Z | import os
from collections import OrderedDict
from typing import Tuple, List, Callable
from fs_s3fs import S3FS
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
from skimage.exposure import match_histograms
from datetime import datetime
from eolearn.core import EOPatch
def a... | 42.657732 | 120 | 0.64353 | import os
from collections import OrderedDict
from typing import Tuple, List, Callable
from fs_s3fs import S3FS
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
from skimage.exposure import match_histograms
from datetime import datetime
from eolearn.core import EOPatch
def a... | true | true |
f70f10e88059a23ec5dc7d82b780582041e1ec1f | 5,119 | py | Python | cost.py | Inspirateur/PitchAssignment | a79f830ea91ef51cb2c8fd59f99ae66c6ba0df08 | [
"MIT"
] | null | null | null | cost.py | Inspirateur/PitchAssignment | a79f830ea91ef51cb2c8fd59f99ae66c6ba0df08 | [
"MIT"
] | null | null | null | cost.py | Inspirateur/PitchAssignment | a79f830ea91ef51cb2c8fd59f99ae66c6ba0df08 | [
"MIT"
] | 1 | 2021-09-20T07:48:36.000Z | 2021-09-20T07:48:36.000Z | from collections import defaultdict
from itertools import product
MULTITASK_PENALTY = 1
AUTHOR_PENALTY = 2
RELATION_COST = .05
DEFAULT_FLEXIBILITY = .1
OVERREQ_PENALTY = 0.5
def workload_diff(target, proposed):
"""
Helper for pitches_cost
:param target: <role, load>
:param proposed: <role, load>
:... | 35.797203 | 104 | 0.586247 | from collections import defaultdict
from itertools import product
MULTITASK_PENALTY = 1
AUTHOR_PENALTY = 2
RELATION_COST = .05
DEFAULT_FLEXIBILITY = .1
OVERREQ_PENALTY = 0.5
def workload_diff(target, proposed):
total = 0
for role in target:
diff = target[role] - (proposed[role] if role in pro... | true | true |
f70f1152cc44929634c97df0c7fa4576d6daf8fb | 590 | py | Python | DynamicProgramming/MaximumTradingProfit.py | kopok2/algorithms | efb6a423a8447d99584335e9fef8d9b3c74e2ad8 | [
"MIT"
] | null | null | null | DynamicProgramming/MaximumTradingProfit.py | kopok2/algorithms | efb6a423a8447d99584335e9fef8d9b3c74e2ad8 | [
"MIT"
] | null | null | null | DynamicProgramming/MaximumTradingProfit.py | kopok2/algorithms | efb6a423a8447d99584335e9fef8d9b3c74e2ad8 | [
"MIT"
] | null | null | null | # coding=utf-8
"""Maximum trade profit problem dynamic programming solution Python implementation."""
def mx_profit(prices):
n = len(prices)
profit = [0] * n
mxp = prices[n - 1]
for i in range(n - 2, -1, -1):
mxp = max(mxp, prices[i])
profit[i] = max(profit[i + 1], mxp - prices[i])
... | 26.818182 | 86 | 0.561017 |
def mx_profit(prices):
n = len(prices)
profit = [0] * n
mxp = prices[n - 1]
for i in range(n - 2, -1, -1):
mxp = max(mxp, prices[i])
profit[i] = max(profit[i + 1], mxp - prices[i])
mnp = prices[0]
for i in range(1, n):
mnp = min(mnp, prices[i])
profit[i] = max(... | true | true |
f70f116ad6d2403ad613a608d5c4ed8b8378c8de | 9,419 | py | Python | tests/end_to_end/test_target_redshift.py | danielerapati/pipelinewise | d36d93c504e40d101e0af61f2aa6a827c3c267b8 | [
"Apache-2.0"
] | 2 | 2020-10-05T07:41:36.000Z | 2020-10-05T07:41:37.000Z | tests/end_to_end/test_target_redshift.py | danielerapati/pipelinewise | d36d93c504e40d101e0af61f2aa6a827c3c267b8 | [
"Apache-2.0"
] | 37 | 2021-06-07T07:12:23.000Z | 2022-03-28T23:08:04.000Z | tests/end_to_end/test_target_redshift.py | danielerapati/pipelinewise | d36d93c504e40d101e0af61f2aa6a827c3c267b8 | [
"Apache-2.0"
] | 1 | 2020-11-13T20:43:50.000Z | 2020-11-13T20:43:50.000Z | import os
from datetime import datetime
import pytest
from .helpers import tasks
from .helpers import assertions
from .helpers.env import E2EEnv
DIR = os.path.dirname(__file__)
TAP_MARIADB_ID = 'mariadb_to_rs'
TAP_MARIADB_BUFFERED_STREAM_ID = 'mariadb_to_rs_buffered_stream'
TAP_POSTGRES_ID = 'postgres_to_rs'
TAP_S3_... | 56.740964 | 120 | 0.664826 | import os
from datetime import datetime
import pytest
from .helpers import tasks
from .helpers import assertions
from .helpers.env import E2EEnv
DIR = os.path.dirname(__file__)
TAP_MARIADB_ID = 'mariadb_to_rs'
TAP_MARIADB_BUFFERED_STREAM_ID = 'mariadb_to_rs_buffered_stream'
TAP_POSTGRES_ID = 'postgres_to_rs'
TAP_S3_... | true | true |
f70f126e896590c2b01b095451c40ff7f2026770 | 2,737 | py | Python | donkeycar/templates/config_defaults.py | samvorg/donkey | 156f0fcf9a752c9930e2ce5832454e5c5ad4ea87 | [
"MIT"
] | null | null | null | donkeycar/templates/config_defaults.py | samvorg/donkey | 156f0fcf9a752c9930e2ce5832454e5c5ad4ea87 | [
"MIT"
] | null | null | null | donkeycar/templates/config_defaults.py | samvorg/donkey | 156f0fcf9a752c9930e2ce5832454e5c5ad4ea87 | [
"MIT"
] | 1 | 2018-05-24T17:01:36.000Z | 2018-05-24T17:01:36.000Z | """
CAR CONFIG
This file is read by your car application's manage.py script to change the car
performance.
EXMAPLE
-----------
import dk
cfg = dk.load_config(config_path='~/d2/config.py')
print(cfg.CAMERA_RESOLUTION)
"""
import os
#pi information
PI_USERNAME = "pi"
PI_PASSWD = "raspberry"
PI_HOSTNAME = "raspbe... | 22.252033 | 96 | 0.756303 |
import os
PI_USERNAME = "pi"
PI_PASSWD = "raspberry"
PI_HOSTNAME = "raspberrypi.local"
PI_DONKEY_ROOT = "/home/pi/d2"
CAR_PATH = PACKAGE_PATH = os.path.dirname(os.path.realpath(__file__))
DATA_PATH = os.path.join(CAR_PATH, 'data')
MODELS_PATH = os.path.join(CAR_PATH, 'models')
DRIVE_LOOP_HZ = 20
MAX_LOOPS = 100... | true | true |
f70f13d73c9188fa81bf8e7e7ab80aefc3027697 | 14,758 | py | Python | fugue/execution/factory.py | fugue-project/fugue | 838fdaa794c62e8bdc7f1474818d9491d5d39ed7 | [
"Apache-2.0"
] | 547 | 2020-09-22T08:30:14.000Z | 2022-03-30T23:11:05.000Z | fugue/execution/factory.py | fugue-project/fugue | 838fdaa794c62e8bdc7f1474818d9491d5d39ed7 | [
"Apache-2.0"
] | 196 | 2020-09-22T23:08:26.000Z | 2022-03-26T21:22:48.000Z | fugue/execution/factory.py | fugue-project/fugue | 838fdaa794c62e8bdc7f1474818d9491d5d39ed7 | [
"Apache-2.0"
] | 37 | 2020-09-23T17:05:00.000Z | 2022-03-29T18:26:52.000Z | from typing import Any, Callable, Dict, Optional, Type, Union
from fugue.execution.execution_engine import ExecutionEngine, SQLEngine
from fugue.execution.native_execution_engine import NativeExecutionEngine
from triad.utils.convert import to_instance
from triad import assert_or_throw
class _ExecutionEngineFactory(o... | 36.529703 | 88 | 0.629896 | from typing import Any, Callable, Dict, Optional, Type, Union
from fugue.execution.execution_engine import ExecutionEngine, SQLEngine
from fugue.execution.native_execution_engine import NativeExecutionEngine
from triad.utils.convert import to_instance
from triad import assert_or_throw
class _ExecutionEngineFactory(o... | true | true |
f70f158e9a7b259d04251a187e3972e2d88d6610 | 2,151 | py | Python | ranndom_m.py | aaparikh/Intermediate-Python-Practice | 6f49bea8f677e7ed500cd1ec91df4c8531832abb | [
"Apache-2.0"
] | 1 | 2022-03-08T16:35:51.000Z | 2022-03-08T16:35:51.000Z | ranndom_m.py | aaparikh/Intermediate-Python-Practice | 6f49bea8f677e7ed500cd1ec91df4c8531832abb | [
"Apache-2.0"
] | null | null | null | ranndom_m.py | aaparikh/Intermediate-Python-Practice | 6f49bea8f677e7ed500cd1ec91df4c8531832abb | [
"Apache-2.0"
] | null | null | null | #there are many ways we can do random numbers
#1. import random
#used to produce pseudo-random numbers.
# They are called pseudo-random because they are not truly random and can be reproduced.
import random
a = random.random() #random float between 0 and 1
b = random.uniform(1,10) #random float between 1 and 10
c = ... | 53.775 | 127 | 0.748024 |
import random
a = random.random()
b = random.uniform(1,10)
c = random.randrange(1,10)
d = random.randint(1,10)
e = random.choice(['a','b','c'])
f = random.sample(range(1,10),3)
g = random.choices(range(1,10),k=3)
h = random.normalvariate(0,1)
random.shuffle(['a','b','c'])
random.seed(10)
import secre... | true | true |
f70f16405f2a7091f370917811545289d3bd69fa | 2,873 | py | Python | core/migrations/0001_initial.py | uadson/django-consumindo-api | 21213205d9dfb816f729a15ba3623724d97fd4ce | [
"MIT"
] | 1 | 2021-11-17T02:41:38.000Z | 2021-11-17T02:41:38.000Z | core/migrations/0001_initial.py | uadson/django-consumindo-api | 21213205d9dfb816f729a15ba3623724d97fd4ce | [
"MIT"
] | 1 | 2021-11-16T15:38:06.000Z | 2021-11-16T15:38:06.000Z | core/migrations/0001_initial.py | uadson/django-consumindo-api | 21213205d9dfb816f729a15ba3623724d97fd4ce | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-16 11:37
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_m... | 63.844444 | 329 | 0.663766 |
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
... | true | true |
f70f16af7eacc72139cb3aa69abab59899a7fc3b | 1,183 | py | Python | tests/aa_pbs_exporter/test_aa_pbs_exporter.py | DonalChilde/aa_pbs_exporter | a627cd9fbd76f4cf27e83e0867074e9d2091dbd9 | [
"MIT"
] | null | null | null | tests/aa_pbs_exporter/test_aa_pbs_exporter.py | DonalChilde/aa_pbs_exporter | a627cd9fbd76f4cf27e83e0867074e9d2091dbd9 | [
"MIT"
] | null | null | null | tests/aa_pbs_exporter/test_aa_pbs_exporter.py | DonalChilde/aa_pbs_exporter | a627cd9fbd76f4cf27e83e0867074e9d2091dbd9 | [
"MIT"
] | null | null | null | # #!/usr/bin/env python
# """Tests for `aa_pbs_exporter` package."""
# from click.testing import CliRunner
# from aa_pbs_exporter.cli import aa_pbs_exporter_cli as cli
# def test_content(response):
# """Sample pytest test function with the pytest fixture as an argument."""
# # from bs4 import BeautifulSoup... | 32.861111 | 79 | 0.67033 | true | true | |
f70f18cff050b3c4ad8472311641f95c9352b029 | 3,185 | py | Python | test_runner.py | dbulka/pytests | d2658cff3832293cb1b8abcd970f7df83a2b5035 | [
"MIT"
] | null | null | null | test_runner.py | dbulka/pytests | d2658cff3832293cb1b8abcd970f7df83a2b5035 | [
"MIT"
] | null | null | null | test_runner.py | dbulka/pytests | d2658cff3832293cb1b8abcd970f7df83a2b5035 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import os
import sys
import time
from echopy import Echo
from project import RESOURCES_DIR, BLOCK_RELEASE_INTERVAL
if "BASE_URL" not in os.environ:
BASE_URL = json.load(open(os.path.join(RESOURCES_DIR, "urls.json")))["BASE_URL"]
else:
BASE_URL = os.environ["BASE_URL"]
cat... | 26.322314 | 115 | 0.69325 |
import json
import os
import sys
import time
from echopy import Echo
from project import RESOURCES_DIR, BLOCK_RELEASE_INTERVAL
if "BASE_URL" not in os.environ:
BASE_URL = json.load(open(os.path.join(RESOURCES_DIR, "urls.json")))["BASE_URL"]
else:
BASE_URL = os.environ["BASE_URL"]
categories = [
'a... | true | true |
f70f19d000d6f8359c77e2784b7e70d5352e4de1 | 11,800 | py | Python | pythainlp/transliterate/thai2rom.py | Subarna578/pythainlp | 9650a40396719284add17bb09f50e948dea41053 | [
"Apache-2.0"
] | null | null | null | pythainlp/transliterate/thai2rom.py | Subarna578/pythainlp | 9650a40396719284add17bb09f50e948dea41053 | [
"Apache-2.0"
] | null | null | null | pythainlp/transliterate/thai2rom.py | Subarna578/pythainlp | 9650a40396719284add17bb09f50e948dea41053 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Romanization of Thai words based on machine-learnt engine ("thai2rom")
"""
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from pythainlp.corpus import download, get_corpus_path
device = torch.device("cuda:0" if torch.cuda.is_available()... | 33.810888 | 79 | 0.592373 |
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from pythainlp.corpus import download, get_corpus_path
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
class ThaiTransliterator:
def __init__(self):
self.__filemodel = g... | true | true |
f70f1afff68e5a2398c858fe97997b9eef497a0d | 19,508 | py | Python | sphinxcontrib/doxylink/doxylink.py | sphinx-contrib/doxylink | 0c8bda7504e483b527bd8f516a240547caa01646 | [
"BSD-2-Clause"
] | 9 | 2017-12-04T14:05:55.000Z | 2021-08-04T12:28:36.000Z | sphinxcontrib/doxylink/doxylink.py | sphinx-contrib/doxylink | 0c8bda7504e483b527bd8f516a240547caa01646 | [
"BSD-2-Clause"
] | 27 | 2017-12-02T13:39:17.000Z | 2021-09-10T09:57:57.000Z | sphinxcontrib/doxylink/doxylink.py | sphinx-contrib/doxylink | 0c8bda7504e483b527bd8f516a240547caa01646 | [
"BSD-2-Clause"
] | 14 | 2017-11-27T08:41:14.000Z | 2022-02-02T08:35:55.000Z | # -*- coding: utf-8 -*-
import os
import re
import requests
import shutil
import time
import xml.etree.ElementTree as ET
import urllib.parse
from collections import namedtuple
from dateutil.parser import parse as parsedate
from docutils import nodes, utils
from sphinx.util.nodes import split_explicit_title
from sphin... | 43.544643 | 219 | 0.629947 |
import os
import re
import requests
import shutil
import time
import xml.etree.ElementTree as ET
import urllib.parse
from collections import namedtuple
from dateutil.parser import parse as parsedate
from docutils import nodes, utils
from sphinx.util.nodes import split_explicit_title
from sphinx.util.console import b... | true | true |
f70f1b00fd0ae86be320e4714bb9c7b34baf8028 | 15,022 | py | Python | speechbrain/lobes/models/huggingface_wav2vec.py | RaphaelOlivier/speechbrain | 142dc6caa4b46ca4c9341b0cd39627f489808749 | [
"Apache-2.0"
] | null | null | null | speechbrain/lobes/models/huggingface_wav2vec.py | RaphaelOlivier/speechbrain | 142dc6caa4b46ca4c9341b0cd39627f489808749 | [
"Apache-2.0"
] | null | null | null | speechbrain/lobes/models/huggingface_wav2vec.py | RaphaelOlivier/speechbrain | 142dc6caa4b46ca4c9341b0cd39627f489808749 | [
"Apache-2.0"
] | null | null | null | """This lobe enables the integration of huggingface pretrained wav2vec2/hubert/wavlm models.
Reference: https://arxiv.org/abs/2006.11477
Reference: https://arxiv.org/abs/1904.05862
Reference: https://arxiv.org/abs/2110.13900
Transformer from HuggingFace needs to be installed:
https://huggingface.co/transformers/instal... | 36.19759 | 123 | 0.637598 |
import os
import torch
import logging
import pathlib
import numpy as np
import torch.nn.functional as F
from torch import nn
from huggingface_hub import model_info
from speechbrain.pretrained.fetching import fetch
try:
import transformers
from transformers import Wav2Vec2Model, HubertModel, WavLMModel, Data2... | true | true |
f70f1b1d9f8febeb246974b7a40d95a388399f2c | 318 | py | Python | Python/Whatsapp_Sms_Bomber/xpath.py | CharvyJain/Rotten-Scripts | c9b8f7dde378620e4a82eae7aacec53f1eeea3c5 | [
"MIT"
] | 3 | 2021-08-19T08:38:10.000Z | 2022-01-03T14:37:50.000Z | Python/Whatsapp_Sms_Bomber/xpath.py | SKAUL05/Rotten-Scripts | c44e69754bbecb8a547fe2cc3a29be5acf97c46a | [
"MIT"
] | 3 | 2022-01-15T07:33:28.000Z | 2022-03-24T04:23:03.000Z | Python/Whatsapp_Sms_Bomber/xpath.py | SKAUL05/Rotten-Scripts | c44e69754bbecb8a547fe2cc3a29be5acf97c46a | [
"MIT"
] | 1 | 2020-12-25T18:42:30.000Z | 2020-12-25T18:42:30.000Z | newchat_xpath= "//*[@id='side']/header/div[2]/div/span/div[2]"
search_xpath= "//*[@id='app']/div/div/div[2]/div[1]/span/div/span/div/div[1]/div/label/div/div[2]"
#user_xpath= "//span[@title='{}']"
message_xpath= "//*[@id='main']/footer/div[1]/div[2]/div/div[2]"
sendbutton_xpath= "//*[@id='main']/footer/div[1]/div[3]" | 63.6 | 98 | 0.625786 | newchat_xpath= "//*[@id='side']/header/div[2]/div/span/div[2]"
search_xpath= "//*[@id='app']/div/div/div[2]/div[1]/span/div/span/div/div[1]/div/label/div/div[2]"
message_xpath= "//*[@id='main']/footer/div[1]/div[2]/div/div[2]"
sendbutton_xpath= "//*[@id='main']/footer/div[1]/div[3]" | true | true |
f70f1b4158f8ca00b905ad9334de0f38c58821fd | 15,602 | py | Python | vrchatapi/model/create_world_request.py | vrchatapi/vrchatapi-python | afe5ec9fda298723e7408358473aafe343e27d18 | [
"MIT"
] | 8 | 2021-08-25T02:35:30.000Z | 2022-03-28T18:11:58.000Z | vrchatapi/model/create_world_request.py | vrchatapi/vrchatapi-python | afe5ec9fda298723e7408358473aafe343e27d18 | [
"MIT"
] | 1 | 2022-03-18T20:29:30.000Z | 2022-03-18T20:35:05.000Z | vrchatapi/model/create_world_request.py | vrchatapi/vrchatapi-python | afe5ec9fda298723e7408358473aafe343e27d18 | [
"MIT"
] | 1 | 2022-01-11T10:49:12.000Z | 2022-01-11T10:49:12.000Z | """
VRChat API Documentation
The version of the OpenAPI document: 1.6.8
Contact: me@ruby.js.org
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from vrchatapi.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
... | 44.1983 | 236 | 0.563966 |
import re
import sys
from vrchatapi.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
from ..m... | true | true |
f70f1b515751dfaf4638ec73883e1665c80bf12e | 67,139 | py | Python | poky/bitbake/lib/bb/fetch2/__init__.py | buildlinux/unityos | dcbe232d0589013d77a62c33959d6a69f9bfbc5e | [
"Apache-2.0"
] | null | null | null | poky/bitbake/lib/bb/fetch2/__init__.py | buildlinux/unityos | dcbe232d0589013d77a62c33959d6a69f9bfbc5e | [
"Apache-2.0"
] | null | null | null | poky/bitbake/lib/bb/fetch2/__init__.py | buildlinux/unityos | dcbe232d0589013d77a62c33959d6a69f9bfbc5e | [
"Apache-2.0"
] | null | null | null | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementations
Classes for obtaining upstream sources for the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2012 Intel Corporation
#
# This program is free software; you c... | 36.038111 | 416 | 0.579574 |
import os, re
import signal
import logging
import urllib.request, urllib.parse, urllib.error
if 'git' not in urllib.parse.uses_netloc:
urllib.parse.uses_netloc.append('git')
import operator
import collections
import subprocess
import pickle
import errno
import bb.persist_data, bb.utils
import b... | true | true |
f70f1b99f377edef719842ceaad9281b62f33dae | 1,801 | py | Python | src/summ/rank_sent.py | yumoxu/querysum | 924c3a0789a50d82f23bcc8faf95407739c0b171 | [
"MIT"
] | 18 | 2020-11-20T03:11:42.000Z | 2021-11-02T10:42:15.000Z | src/summ/rank_sent.py | yumoxu/querysum | 924c3a0789a50d82f23bcc8faf95407739c0b171 | [
"MIT"
] | 15 | 2020-12-28T16:41:12.000Z | 2021-12-16T16:56:24.000Z | src/summ/rank_sent.py | yumoxu/querysum | 924c3a0789a50d82f23bcc8faf95407739c0b171 | [
"MIT"
] | 2 | 2021-01-05T13:24:43.000Z | 2021-06-07T10:54:19.000Z | # -*- coding: utf-8 -*-
from os.path import dirname, abspath
import sys
sys.path.insert(0, dirname(dirname(abspath(__file__))))
import utils.config_loader as config
import utils.config_loader as config
import utils.tools as tools
import torch
import shutil
versions = ['sl', 'alpha']
para_org = True
for vv in versio... | 26.880597 | 106 | 0.642976 |
from os.path import dirname, abspath
import sys
sys.path.insert(0, dirname(dirname(abspath(__file__))))
import utils.config_loader as config
import utils.config_loader as config
import utils.tools as tools
import torch
import shutil
versions = ['sl', 'alpha']
para_org = True
for vv in versions:
if config.meta_... | true | true |
f70f1c03d635f43dee9281507f189ddd0c443a45 | 2,237 | py | Python | mars/web/dashboard.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | 2 | 2019-03-29T04:11:10.000Z | 2020-07-08T10:19:54.000Z | mars/web/dashboard.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | null | null | null | mars/web/dashboard.py | HarshCasper/mars | 4c12c968414d666c7a10f497bc22de90376b1932 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 43.019231 | 96 | 0.673223 |
from .server import MarsWebAPI, MarsRequestHandler, register_web_handler, get_jinja_env
_jinja_env = get_jinja_env()
class DashboardHandler(MarsRequestHandler):
def get(self):
web_api = MarsWebAPI(self._scheduler)
scheduler_infos = web_api.get_schedulers_info()
worker_infos ... | true | true |
f70f1e3812bc6ff84fd875a359dea536690df0d9 | 5,576 | py | Python | pilco/environments/custom/continuous_mountaincar.py | sbrml/pilco | 77b6d8b9033ffdb23cae4936b028f42144f37846 | [
"MIT"
] | null | null | null | pilco/environments/custom/continuous_mountaincar.py | sbrml/pilco | 77b6d8b9033ffdb23cae4936b028f42144f37846 | [
"MIT"
] | 4 | 2020-11-13T18:43:28.000Z | 2022-02-10T01:17:03.000Z | pilco/environments/custom/continuous_mountaincar.py | sbrml/pilco | 77b6d8b9033ffdb23cae4936b028f42144f37846 | [
"MIT"
] | 1 | 2020-03-22T10:14:21.000Z | 2020-03-22T10:14:21.000Z | """
Our modification of the OpenAI Gym Continuous Mountain Car by Olivier Sigaud:
https://github.com/openai/gym/blob/master/gym/envs/classic_control/continuous_mountain_car.py
which was (ultimately) based on Sutton's implementation:
http://incompleteideas.net/sutton/MountainCar/MountainCar1.cp
"""
from pilco.errors i... | 31.862857 | 93 | 0.565638 |
from pilco.errors import EnvironmentError
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
class MountainCar(gym.Env):
metadata = {'render.modes': ['human', 'rgb_array'],
'video.frames_per_second': 30}
def __init__(self):
self.min_action... | true | true |
f70f1eaceada771991938b17b192bade1dc91d80 | 14,849 | py | Python | release/scripts/modules/bpy_extras/mesh_utils.py | rbabari/blender | 6daa85f14b2974abfc3d0f654c5547f487bb3b74 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 116 | 2015-11-02T16:36:53.000Z | 2021-06-08T20:36:18.000Z | release/scripts/modules/bpy_extras/mesh_utils.py | rbabari/blender | 6daa85f14b2974abfc3d0f654c5547f487bb3b74 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 39 | 2016-04-25T12:18:34.000Z | 2021-03-01T19:06:36.000Z | release/scripts/modules/bpy_extras/mesh_utils.py | rbabari/blender | 6daa85f14b2974abfc3d0f654c5547f487bb3b74 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 19 | 2016-01-24T14:24:00.000Z | 2020-07-19T05:26:24.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 31.393235 | 80 | 0.536534 | loop_indices for poly in mesh.polygons]
luv_hash = {}
luv_hash_get = luv_hash.get
luv_hash_ls = [None] * len(uv_loops)
for pi, poly_indices in enumerate(poly_loops):
for li in poly_indices:
uv = uv_loops[li]
uv_hub = luv_hash_get(uv)
if uv_hub is None:
... | true | true |
f70f1f28974c7dca57cac919fb7d82881164e5fb | 983 | py | Python | src/notif/urls.py | triump0870/notif | ccc36ce85b3721ea85bf22038541d375c2ff5996 | [
"MIT"
] | null | null | null | src/notif/urls.py | triump0870/notif | ccc36ce85b3721ea85bf22038541d375c2ff5996 | [
"MIT"
] | null | null | null | src/notif/urls.py | triump0870/notif | ccc36ce85b3721ea85bf22038541d375c2ff5996 | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
import profiles.urls
import accounts.urls
from . import views
urlpatterns = [
url(r'^$', views.HomePage.as_view(), name='home'),
url(r'^about/$', views.AboutPag... | 32.766667 | 76 | 0.708037 | from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
import profiles.urls
import accounts.urls
from . import views
urlpatterns = [
url(r'^$', views.HomePage.as_view(), name='home'),
url(r'^about/$', views.AboutPag... | true | true |
f70f1fa11ff388ced5d59e8a7ef2a1be228de8c6 | 516 | py | Python | vunit/verilog/check/run.py | ThomasWismer/vunit | 3dd2d34e72c21d7a5b23cbf5a775ea28923a7718 | [
"Artistic-2.0",
"Apache-2.0"
] | 2 | 2021-09-24T01:44:27.000Z | 2022-01-18T19:42:16.000Z | vunit/verilog/check/run.py | ThomasWismer/vunit | 3dd2d34e72c21d7a5b23cbf5a775ea28923a7718 | [
"Artistic-2.0",
"Apache-2.0"
] | 1 | 2021-09-12T01:03:44.000Z | 2021-09-19T15:28:12.000Z | vunit/verilog/check/run.py | ThomasWismer/vunit | 3dd2d34e72c21d7a5b23cbf5a775ea28923a7718 | [
"Artistic-2.0",
"Apache-2.0"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014-2021, Lars Asplund lars.anders.asplund@gmail.com
from pathlib import Path
from vunit.verilog impo... | 28.666667 | 75 | 0.728682 |
from pathlib import Path
from vunit.verilog import VUnit
ROOT = Path(__file__).parent
VU = VUnit.from_argv()
VU.add_library("lib").add_source_files(ROOT / "test" / "*.sv")
VU.set_sim_option("modelsim.vsim_flags.gui", ["-novopt"])
VU.main()
| true | true |
f70f1fee1810154c5a52377ec53945a73677dcdc | 1,294 | py | Python | stubs/System/Drawing/Configuration.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs/System/Drawing/Configuration.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs/System/Drawing/Configuration.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | # encoding: utf-8
# module System.Drawing.Configuration calls itself Configuration
# from System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class SystemDrawingSection(ConfigurationSection):
""" SystemDra... | 36.971429 | 151 | 0.719474 |
class SystemDrawingSection(ConfigurationSection):
BitmapSuffix = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""
HasContext = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
| true | true |
f70f210275c45c6bc3b24ff9b6183cf804f8307c | 411 | py | Python | 18_greatest.py | hritxvij/python-basic-practise | 42f55320ff55346558ecc164967cbe399060247c | [
"Apache-2.0"
] | null | null | null | 18_greatest.py | hritxvij/python-basic-practise | 42f55320ff55346558ecc164967cbe399060247c | [
"Apache-2.0"
] | null | null | null | 18_greatest.py | hritxvij/python-basic-practise | 42f55320ff55346558ecc164967cbe399060247c | [
"Apache-2.0"
] | null | null | null | num1 = input("Enter the first number:\n ")
num2 = input("Enter the second number:\n ")
num3 = input("Enter the third number:\n ")
num4 = input("Enter the fourth number:\n ")
if (num1>num2) and (num2>num3):
print("The greatest number is:", num1)
elif (num2>num1) and (num1>num3):
... | 31.615385 | 55 | 0.608273 | num1 = input("Enter the first number:\n ")
num2 = input("Enter the second number:\n ")
num3 = input("Enter the third number:\n ")
num4 = input("Enter the fourth number:\n ")
if (num1>num2) and (num2>num3):
print("The greatest number is:", num1)
elif (num2>num1) and (num1>num3):
... | true | true |
f70f2224b7c29a2a61b7f2a64979a1761e77d84f | 11,600 | py | Python | code/python/IRNContacts/v1/fds/sdk/IRNContacts/model/operation_type.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/IRNContacts/v1/fds/sdk/IRNContacts/model/operation_type.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/IRNContacts/v1/fds/sdk/IRNContacts/model/operation_type.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
IRN API v1
Allows users to extract, create, update and configure IRN data. # noqa: E501
The version of the OpenAPI document: 1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.IRNContacts.model_utils import ( # noqa: F401
ApiTy... | 40.277778 | 110 | 0.547845 |
import re
import sys
from fds.sdk.IRNContacts.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
... | true | true |
f70f2240675cbbff5008d275512cd6a5bb90088b | 2,087 | py | Python | dvc/dependency/repo.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | null | null | null | dvc/dependency/repo.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | null | null | null | dvc/dependency/repo.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import copy
from funcy import merge
from schema import Optional
from contextlib import contextmanager
from dvc.external_repo import external_repo
from dvc.utils.compat import str
from .local import DependencyLOCAL
class DependencyREPO(DependencyLOCAL):
PARAM_REPO = "rep... | 26.75641 | 79 | 0.643987 | from __future__ import unicode_literals
import copy
from funcy import merge
from schema import Optional
from contextlib import contextmanager
from dvc.external_repo import external_repo
from dvc.utils.compat import str
from .local import DependencyLOCAL
class DependencyREPO(DependencyLOCAL):
PARAM_REPO = "rep... | true | true |
f70f22e7a983dcb07f28f40547898d34230c6980 | 843 | py | Python | examples/custom_problem.py | eltociear/NiaPy | 7884aefec8f013d9f8db5c1af7080a61dd19a31d | [
"MIT"
] | null | null | null | examples/custom_problem.py | eltociear/NiaPy | 7884aefec8f013d9f8db5c1af7080a61dd19a31d | [
"MIT"
] | null | null | null | examples/custom_problem.py | eltociear/NiaPy | 7884aefec8f013d9f8db5c1af7080a61dd19a31d | [
"MIT"
] | null | null | null | # encoding=utf8
# This is temporary fix to import module from parent folder
# It will be removed when package is published on PyPI
import sys
sys.path.append('../')
import numpy as np
from niapy.task import StoppingTask
from niapy.problems import Problem
from niapy.algorithms.basic import ParticleSwarmAlgorithm
cla... | 31.222222 | 105 | 0.725979 |
import sys
sys.path.append('../')
import numpy as np
from niapy.task import StoppingTask
from niapy.problems import Problem
from niapy.algorithms.basic import ParticleSwarmAlgorithm
class MyProblem(Problem):
def __init__(self, dimension, lower=-10, upper=10, *args, **kwargs):
super().__init__(dimensi... | true | true |
f70f2304c5bc68c201e9756c24ea51014e1794d0 | 8,831 | py | Python | datahub/search/elasticsearch.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 6 | 2019-12-02T16:11:24.000Z | 2022-03-18T10:02:02.000Z | datahub/search/elasticsearch.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 1,696 | 2019-10-31T14:08:37.000Z | 2022-03-29T12:35:57.000Z | datahub/search/elasticsearch.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 9 | 2019-11-22T12:42:03.000Z | 2021-09-03T14:25:05.000Z | from contextlib import contextmanager
from logging import getLogger
from django.conf import settings
from elasticsearch.helpers import bulk as es_bulk
from elasticsearch_dsl import analysis, Index
from elasticsearch_dsl.connections import connections
logger = getLogger(__name__)
# Normalises values to improve sort... | 29.049342 | 98 | 0.674895 | from contextlib import contextmanager
from logging import getLogger
from django.conf import settings
from elasticsearch.helpers import bulk as es_bulk
from elasticsearch_dsl import analysis, Index
from elasticsearch_dsl.connections import connections
logger = getLogger(__name__)
lowercase_asciifolding_normalizer ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.