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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72ac5724f4c0949289c5827a02bc25b216cc4ef | 687 | py | Python | setup.py | DocNow/twarc-hashtags | 2a8ab84c9585b6efe9696194b6030ce5486a9e7e | [
"MIT"
] | 3 | 2021-09-09T06:22:39.000Z | 2022-02-25T13:51:29.000Z | setup.py | DocNow/twarc-hashtags | 2a8ab84c9585b6efe9696194b6030ce5486a9e7e | [
"MIT"
] | 1 | 2022-01-25T11:07:05.000Z | 2022-01-27T01:33:00.000Z | setup.py | DocNow/twarc-hashtags | 2a8ab84c9585b6efe9696194b6030ce5486a9e7e | [
"MIT"
] | null | null | null | import setuptools
with open("README.md") as f:
long_description = f.read()
setuptools.setup(
name='twarc-hashtags',
version='0.0.5',
url='https://github.com/docnow/twarc-hashtags',
author='Ed Summers',
author_email='ehs@pobox.com',
py_modules=['twarc_hashtags'],
description='A twarc pl... | 27.48 | 71 | 0.6754 | import setuptools
with open("README.md") as f:
long_description = f.read()
setuptools.setup(
name='twarc-hashtags',
version='0.0.5',
url='https://github.com/docnow/twarc-hashtags',
author='Ed Summers',
author_email='ehs@pobox.com',
py_modules=['twarc_hashtags'],
description='A twarc pl... | true | true |
f72ac585b2ba49e680b69313a2fa0d0a5d6a749c | 137 | py | Python | Python/Regex and Parsing/Validating Roman Numerals/Solution.py | PawarAditi/HackerRank | fcd9d1450ee293372ce5f1d4a3b7284ecf472657 | [
"MIT"
] | 219 | 2018-06-17T19:47:22.000Z | 2022-03-27T15:28:56.000Z | Python/Regex and Parsing/Validating Roman Numerals/Solution.py | PawarAditi/HackerRank | fcd9d1450ee293372ce5f1d4a3b7284ecf472657 | [
"MIT"
] | 2 | 2020-08-12T16:47:41.000Z | 2020-12-15T17:05:57.000Z | Python/Regex and Parsing/Validating Roman Numerals/Solution.py | PawarAditi/HackerRank | fcd9d1450ee293372ce5f1d4a3b7284ecf472657 | [
"MIT"
] | 182 | 2018-12-12T21:36:50.000Z | 2022-03-26T17:49:51.000Z | import re
regex_pattern = r'M{0,3}(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[VX]|V?I{0,3})$'
print(str(bool(re.match(regex_pattern, input())))) | 27.4 | 74 | 0.605839 | import re
regex_pattern = r'M{0,3}(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[VX]|V?I{0,3})$'
print(str(bool(re.match(regex_pattern, input())))) | true | true |
f72ac6556032482e4ba83a528d58e88c2de8f5b6 | 3,955 | py | Python | SimpleServer.py | wanzhiguo/mininero | 7dd71b02a4613478b59b2670ccf7c74a22cc2ffd | [
"BSD-3-Clause"
] | 64 | 2015-06-12T19:29:51.000Z | 2022-01-03T17:14:56.000Z | SimpleServer.py | wanzhiguo/mininero | 7dd71b02a4613478b59b2670ccf7c74a22cc2ffd | [
"BSD-3-Clause"
] | 4 | 2015-11-27T18:49:40.000Z | 2017-12-14T21:32:48.000Z | SimpleServer.py | wanzhiguo/mininero | 7dd71b02a4613478b59b2670ccf7c74a22cc2ffd | [
"BSD-3-Clause"
] | 39 | 2016-02-07T08:47:02.000Z | 2022-03-07T06:07:10.000Z | import MiniNero
import ed25519
import binascii
import PaperWallet
import cherrypy
import os
import time
import bitmonerod
import SimpleXMR2
lasttime = 0
def HexSigningPubKey(s):
return binascii.hexlify(ed25519.publickey(ed25519.encodeint(MiniNero.hexToInt(s))))
def Signature(m, sk):
#note this seems to return ni... | 35.3125 | 100 | 0.588369 | import MiniNero
import ed25519
import binascii
import PaperWallet
import cherrypy
import os
import time
import bitmonerod
import SimpleXMR2
lasttime = 0
def HexSigningPubKey(s):
return binascii.hexlify(ed25519.publickey(ed25519.encodeint(MiniNero.hexToInt(s))))
def Signature(m, sk):
sk2 = ed25519.encodeint(M... | true | true |
f72ac71ab4bf2592bbd31344ee98206db5efb0b0 | 1,390 | py | Python | dvc/command/run.py | IlyaKisil/dvc | 1f549d665944a314331282a132b1ba3cc3a835f5 | [
"Apache-2.0"
] | null | null | null | dvc/command/run.py | IlyaKisil/dvc | 1f549d665944a314331282a132b1ba3cc3a835f5 | [
"Apache-2.0"
] | null | null | null | dvc/command/run.py | IlyaKisil/dvc | 1f549d665944a314331282a132b1ba3cc3a835f5 | [
"Apache-2.0"
] | null | null | null | import dvc.logger as logger
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException
class CmdRun(CmdBase):
def _joined_cmd(self):
if len(self.args.command) == 0:
return ''
if len(self.args.command) == 1:
return self.args.command[0]
cmd = ''
... | 33.095238 | 77 | 0.488489 | import dvc.logger as logger
from dvc.command.base import CmdBase
from dvc.exceptions import DvcException
class CmdRun(CmdBase):
def _joined_cmd(self):
if len(self.args.command) == 0:
return ''
if len(self.args.command) == 1:
return self.args.command[0]
cmd = ''
... | true | true |
f72ac72145f9cff31e471c1a682180a9ab441579 | 1,584 | py | Python | python/misc.py | dnbh/kpg | c9e79b8092434919e9ac90dc199f49845403c2ba | [
"MIT"
] | 69 | 2018-01-08T19:56:55.000Z | 2022-03-05T17:14:05.000Z | python/misc.py | dnbaker/emp | c9e79b8092434919e9ac90dc199f49845403c2ba | [
"MIT"
] | 6 | 2018-04-14T21:09:51.000Z | 2021-07-17T21:08:54.000Z | python/misc.py | dnbaker/emp | c9e79b8092434919e9ac90dc199f49845403c2ba | [
"MIT"
] | 11 | 2018-03-21T19:28:35.000Z | 2021-06-29T17:33:34.000Z | #!/usr/bin/env python
import sys
import string
from collections import defaultdict
def freq(iterable):
"""
Returns a dictionary of counts for each item in an iterable.
>>>freq("ACGTTTAAA")
{'A': 4, 'C': 1, 'G': 1, 'T': 3}
"""
ret = defaultdict(int)
for el in iterable:
ret[el] += 1
... | 22.628571 | 73 | 0.571338 | import sys
import string
from collections import defaultdict
def freq(iterable):
ret = defaultdict(int)
for el in iterable:
ret[el] += 1
return ret
try:
from cytoolz import frequencies as freq
except ImportError:
pass
REV_CMP_TABLE = (str if sys.version_info[0] == 3
... | true | true |
f72ac86bdcf9c11af4e34184f7bc61e8e47c1475 | 1,781 | py | Python | dex/dextIR/CommandListIR.py | jmorse/dexter | 79cefa890d041dfc927aea2a84737aa704ddd35c | [
"MIT"
] | null | null | null | dex/dextIR/CommandListIR.py | jmorse/dexter | 79cefa890d041dfc927aea2a84737aa704ddd35c | [
"MIT"
] | null | null | null | dex/dextIR/CommandListIR.py | jmorse/dexter | 79cefa890d041dfc927aea2a84737aa704ddd35c | [
"MIT"
] | null | null | null | # DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Copyright (c) 2018 by SN Systems Ltd., Sony Interactive Entertainment Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... | 39.577778 | 79 | 0.718136 |
from dex.dextIR.CommandIR import CommandIR
from dex.utils.serialize import SrField, SrObject
class CommandListIR(SrObject):
sr_fields = [
SrField(
'command_list',
CommandIR,
list_of=True,
required_in_init=False,
default_value=list),
]
d... | true | true |
f72ac92ca104149447f8f64cf75ef595d16ca300 | 9,128 | py | Python | tests/operators/test_gcs_to_s3.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-09-06T09:55:18.000Z | 2019-09-06T09:55:18.000Z | tests/operators/test_gcs_to_s3.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/operators/test_gcs_to_s3.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-12-09T08:41:32.000Z | 2019-12-09T08:41:32.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 48.296296 | 86 | 0.594106 |
import unittest
from airflow.operators.gcs_to_s3 import GoogleCloudStorageToS3Operator
from airflow.hooks.S3_hook import S3Hook
from tests.compat import mock
try:
from moto import mock_s3
except ImportError:
mock_s3 = None
TASK_ID = 'test-gcs-list-operator'
GCS_BUCKET = 'test-bucket'
DELIMITER = '.csv'
PREF... | true | true |
f72acb68ed93a51226e787125180c68eb7131f4d | 5,030 | py | Python | gdxpds/read_gdx.py | cdgaete/gdx-pandas | 2b9b00a177268227bce189939cdab081e09cb0dc | [
"BSD-3-Clause"
] | null | null | null | gdxpds/read_gdx.py | cdgaete/gdx-pandas | 2b9b00a177268227bce189939cdab081e09cb0dc | [
"BSD-3-Clause"
] | null | null | null | gdxpds/read_gdx.py | cdgaete/gdx-pandas | 2b9b00a177268227bce189939cdab081e09cb0dc | [
"BSD-3-Clause"
] | null | null | null | # [LICENSE]
# Copyright (c) 2018, Alliance for Sustainable Energy.
# All rights reserved.
#
# Redistribution and use in source and binary forms,
# with or without modification, are permitted provided
# that the following conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright no... | 34.689655 | 91 | 0.706362 |
from collections import OrderedDict
import logging
from gdxpds.tools import Error
from gdxpds.gdx import GdxFile
logger = logging.getLogger(__name__)
class Translator(object):
def __init__(self,gdx_file,gams_dir=None,lazy_load=False):
self.__gdx = GdxFile(gams_dir=gams_dir,lazy_load=lazy_load)
s... | true | true |
f72acbaa7eb80d299ab01ae2d3c86752036d4dac | 24,244 | py | Python | test/api/table/test_table.py | rizwanniazigroupdocs/aspose-words-cloud-python | b943384a1e3c0710cc84df74119e6edf7356037e | [
"MIT"
] | null | null | null | test/api/table/test_table.py | rizwanniazigroupdocs/aspose-words-cloud-python | b943384a1e3c0710cc84df74119e6edf7356037e | [
"MIT"
] | null | null | null | test/api/table/test_table.py | rizwanniazigroupdocs/aspose-words-cloud-python | b943384a1e3c0710cc84df74119e6edf7356037e | [
"MIT"
] | null | null | null | # -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="test_table.py">
# Copyright (c) 2020 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and asso... | 51.803419 | 201 | 0.735068 |
import os
import dateutil.parser
import asposewordscloud.models.requests
from test.base_test_context import BaseTestContext
class TestTable(BaseTestContext):
def test_get_tables(self):
remoteDataFolder = self.remote_test_folder + '/DocumentElements/Tables'
localFile = 'DocumentElements... | true | true |
f72accd8900bf752d4868f03ba6ce4c1c4210e08 | 7,851 | py | Python | kaggle/ghouls-goblins-and-ghosts-boo/script_3.py | josepablocam/janus-public | 4713092b27d02386bdb408213d8edc0dc5859eec | [
"MIT"
] | null | null | null | kaggle/ghouls-goblins-and-ghosts-boo/script_3.py | josepablocam/janus-public | 4713092b27d02386bdb408213d8edc0dc5859eec | [
"MIT"
] | null | null | null | kaggle/ghouls-goblins-and-ghosts-boo/script_3.py | josepablocam/janus-public | 4713092b27d02386bdb408213d8edc0dc5859eec | [
"MIT"
] | null | null | null | #Libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('whitegrid')
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.calibration import Calib... | 47.011976 | 104 | 0.672271 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('whitegrid')
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.calibration import CalibratedClassi... | true | true |
f72acedfe31ef0d6425a9d5e280c234bf012eb1c | 2,456 | py | Python | example.py | macky168/gaopt | bf2785325d3cb4489513f47ed06f745a059262f8 | [
"MIT"
] | null | null | null | example.py | macky168/gaopt | bf2785325d3cb4489513f47ed06f745a059262f8 | [
"MIT"
] | null | null | null | example.py | macky168/gaopt | bf2785325d3cb4489513f47ed06f745a059262f8 | [
"MIT"
] | null | null | null | import gaopt
from gaopt import search_space
import pandas as pd
import numpy as np
import lightgbm as lgb
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score
from sklearn.datasets import load_diabetes
params_range={
'lambda_l1': search_space.discrete_int(-8, 2),
'lambda_... | 31.487179 | 157 | 0.664088 | import gaopt
from gaopt import search_space
import pandas as pd
import numpy as np
import lightgbm as lgb
from sklearn.model_selection import train_test_split
from sklearn.metrics import r2_score
from sklearn.datasets import load_diabetes
params_range={
'lambda_l1': search_space.discrete_int(-8, 2),
'lambda_... | true | true |
f72acf6685fa304f560b7aba21b3cc59df08af86 | 1,407 | py | Python | plotly/validators/contour/colorbar/_tickfont.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2018-07-16T01:51:47.000Z | 2018-07-16T01:51:47.000Z | plotly/validators/contour/colorbar/_tickfont.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/contour/colorbar/_tickfont.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 1 | 2019-02-18T04:12:56.000Z | 2019-02-18T04:12:56.000Z | import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='tickfont', parent_name='contour.colorbar', **kwargs
):
super(TickfontValidator, self).__init__(
plotly_name=plotly_name,
parent... | 39.083333 | 78 | 0.570007 | import _plotly_utils.basevalidators
class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='tickfont', parent_name='contour.colorbar', **kwargs
):
super(TickfontValidator, self).__init__(
plotly_name=plotly_name,
parent... | true | true |
f72acf916cc7270f998cfd07db89c1ac93ca5b18 | 1,812 | py | Python | src/scripts/extract_syscall.py | Manouchehri/Triton-docker | ce49ce9ba49965a5e7f814f2b46e50cc74b704de | [
"BSD-3-Clause"
] | 1 | 2020-11-15T15:21:12.000Z | 2020-11-15T15:21:12.000Z | src/scripts/extract_syscall.py | Manouchehri/Triton-docker | ce49ce9ba49965a5e7f814f2b46e50cc74b704de | [
"BSD-3-Clause"
] | null | null | null | src/scripts/extract_syscall.py | Manouchehri/Triton-docker | ce49ce9ba49965a5e7f814f2b46e50cc74b704de | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
#
# This script is used to generate the files src/utils/syscalls{32,64}.cpp.
# As the list of syscalls depends of your Kernel version. We must
# generate the list at the compile time.
#
from __future__ import print_function
import argparse
import sys
import re
import platform
HEADER = """
/*! ... | 25.885714 | 98 | 0.570088 |
from __future__ import print_function
import argparse
import sys
import re
import platform
HEADER = """
/*! \\file */
#if defined(__unix__) || defined(__APPLE__)
#include <syscalls.hpp>
namespace triton {
namespace os {
namespace unix {
"""
FOOTER = """
}; /* unix namespace */
}; /* os namespace */
... | true | true |
f72ad055c9ca2d52827b7e4aa011c2370f6292dc | 15,695 | py | Python | electrum_ltc/tests/test_lnpeer.py | SynchrotronCoinDev/electrum-ltc | 178589f30ce57ca84e4d8bc7587f39522e9d17b3 | [
"MIT"
] | null | null | null | electrum_ltc/tests/test_lnpeer.py | SynchrotronCoinDev/electrum-ltc | 178589f30ce57ca84e4d8bc7587f39522e9d17b3 | [
"MIT"
] | null | null | null | electrum_ltc/tests/test_lnpeer.py | SynchrotronCoinDev/electrum-ltc | 178589f30ce57ca84e4d8bc7587f39522e9d17b3 | [
"MIT"
] | null | null | null | import asyncio
import tempfile
from decimal import Decimal
import os
from contextlib import contextmanager
from collections import defaultdict
import logging
import concurrent
from concurrent import futures
import unittest
from aiorpcx import TaskGroup
from electrum_ltc import constants
from electrum_ltc.network impo... | 39.633838 | 139 | 0.680663 | import asyncio
import tempfile
from decimal import Decimal
import os
from contextlib import contextmanager
from collections import defaultdict
import logging
import concurrent
from concurrent import futures
import unittest
from aiorpcx import TaskGroup
from electrum_ltc import constants
from electrum_ltc.network impo... | true | true |
f72ad123a16de5b88d83b7f0efe6887a58556b76 | 1,491 | py | Python | examples/map_view_simple_example.py | TomSchimansky/TkinterMapView | eb84f600e9b6bb8c60d88149e277b3abee704a70 | [
"CC0-1.0"
] | 43 | 2022-01-02T04:23:28.000Z | 2022-03-30T03:04:03.000Z | examples/map_view_simple_example.py | TomSchimansky/TkinterMapView | eb84f600e9b6bb8c60d88149e277b3abee704a70 | [
"CC0-1.0"
] | 6 | 2022-02-24T09:19:35.000Z | 2022-03-24T18:32:22.000Z | examples/map_view_simple_example.py | TomSchimansky/TkinterMapView | eb84f600e9b6bb8c60d88149e277b3abee704a70 | [
"CC0-1.0"
] | 4 | 2022-01-03T16:49:04.000Z | 2022-03-21T09:25:44.000Z | import tkinter
import tkintermapview
# create tkinter window
root_tk = tkinter.Tk()
root_tk.geometry(f"{1000}x{700}")
root_tk.title("map_view_simple_example.py")
# create map widget
map_widget = tkintermapview.TkinterMapView(root_tk, width=1000, height=700, corner_radius=0)
map_widget.pack(fill="both", expand=True)
... | 36.365854 | 126 | 0.739772 | import tkinter
import tkintermapview
root_tk = tkinter.Tk()
root_tk.geometry(f"{1000}x{700}")
root_tk.title("map_view_simple_example.py")
map_widget = tkintermapview.TkinterMapView(root_tk, width=1000, height=700, corner_radius=0)
map_widget.pack(fill="both", expand=True)
def marker_click(marker):
print(f"mar... | true | true |
f72ad17de09166bbcef6aaac4ff6b283c77049fa | 2,206 | py | Python | retrieve_response.py | kit-data-manager/gemma | 0ae4e64f966b389c7e7c5619c8fd09bef78c8c87 | [
"Apache-2.0"
] | null | null | null | retrieve_response.py | kit-data-manager/gemma | 0ae4e64f966b389c7e7c5619c8fd09bef78c8c87 | [
"Apache-2.0"
] | null | null | null | retrieve_response.py | kit-data-manager/gemma | 0ae4e64f966b389c7e7c5619c8fd09bef78c8c87 | [
"Apache-2.0"
] | null | null | null | import http.client
import os
import json
import wget
import mapping_functions
import pprint
import sys
HOST = 'episteme2.scc.kit.edu'
PORT = '8080'
URL = os.path.join('http://' + HOST + ':' + PORT, 'api/v1/dataresources')
output_folder = sys.argv[1]
payload = "{\n \t\"resourceType\": {\n \t\t\"typeGeneral\":\"TEXT\"... | 30.638889 | 115 | 0.629193 | import http.client
import os
import json
import wget
import mapping_functions
import pprint
import sys
HOST = 'episteme2.scc.kit.edu'
PORT = '8080'
URL = os.path.join('http://' + HOST + ':' + PORT, 'api/v1/dataresources')
output_folder = sys.argv[1]
payload = "{\n \t\"resourceType\": {\n \t\t\"typeGeneral\":\"TEXT\"... | true | true |
f72ad2f82bf260bd112b090bded6d3c5ba2e8a43 | 1,180 | py | Python | profiles_api/serializers.py | Atique-7/drf-genesis | a333564d285885c7661e3324d5503488d9ced6ae | [
"MIT"
] | null | null | null | profiles_api/serializers.py | Atique-7/drf-genesis | a333564d285885c7661e3324d5503488d9ced6ae | [
"MIT"
] | null | null | null | profiles_api/serializers.py | Atique-7/drf-genesis | a333564d285885c7661e3324d5503488d9ced6ae | [
"MIT"
] | null | null | null | from rest_framework import serializers
from profiles_api import models
class UserProfileSerializer(serializers.ModelSerializer):
"""serializes a user profile object"""
class Meta:
model = models.UserProfile
fields = ('id', 'name', 'email', 'password')
extra_kwargs = {
'pas... | 29.5 | 68 | 0.561864 | from rest_framework import serializers
from profiles_api import models
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = models.UserProfile
fields = ('id', 'name', 'email', 'password')
extra_kwargs = {
'password' : {
'write_only' : T... | true | true |
f72ad439a6e7cf5dac1b087074d4ee471a260a4b | 52 | py | Python | tests/python/overload1.py | jacereda/py2nim | 56fc2699d31241c60bed726f59efea4bf46be238 | [
"MIT"
] | 10 | 2020-03-10T12:01:01.000Z | 2021-05-23T19:47:06.000Z | tests/python/overload1.py | jacereda/py2nim | 56fc2699d31241c60bed726f59efea4bf46be238 | [
"MIT"
] | null | null | null | tests/python/overload1.py | jacereda/py2nim | 56fc2699d31241c60bed726f59efea4bf46be238 | [
"MIT"
] | 1 | 2020-07-17T11:20:56.000Z | 2020-07-17T11:20:56.000Z | def a(z, b):
print(z + b)
a(0, 0.0)
a('e', '')
| 8.666667 | 16 | 0.365385 | def a(z, b):
print(z + b)
a(0, 0.0)
a('e', '')
| true | true |
f72ad5b39fcaee399cd011abf25e5fda0c0342a6 | 24,914 | py | Python | jina/flow/mixin/async_crud.py | liushuigs/jina | b3550e901b2a340924330b5ba2801603e493c933 | [
"Apache-2.0"
] | null | null | null | jina/flow/mixin/async_crud.py | liushuigs/jina | b3550e901b2a340924330b5ba2801603e493c933 | [
"Apache-2.0"
] | 2 | 2021-02-15T01:40:38.000Z | 2021-02-15T02:00:21.000Z | jina/flow/mixin/async_crud.py | liushuigs/jina | b3550e901b2a340924330b5ba2801603e493c933 | [
"Apache-2.0"
] | null | null | null | import warnings
from typing import Union, Iterable, TextIO, Dict, Optional
import numpy as np
from ...clients.base import InputType, CallbackFnType
from ...enums import DataInputType
from ...helper import deprecated_alias
class AsyncCRUDFlowMixin:
"""The asynchronous version of the Mixin for CRUD in Flow"""
... | 40.70915 | 120 | 0.603837 | import warnings
from typing import Union, Iterable, TextIO, Dict, Optional
import numpy as np
from ...clients.base import InputType, CallbackFnType
from ...enums import DataInputType
from ...helper import deprecated_alias
class AsyncCRUDFlowMixin:
@deprecated_alias(
input_fn=('inputs', 0),
buff... | true | true |
f72ad5bc7ad2d8fb6d61ac7005b04ae01a495d56 | 1,629 | py | Python | packages/tool_util/tests/test_tool_linters.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 2 | 2017-03-28T12:11:41.000Z | 2017-04-22T02:58:25.000Z | packages/tool_util/tests/test_tool_linters.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 12 | 2020-07-24T23:55:19.000Z | 2021-12-19T11:40:06.000Z | packages/tool_util/tests/test_tool_linters.py | lawrence14701/galaxy | 7eb2fcb708e7b63e17800c87613ddfa5497c0654 | [
"CC-BY-3.0"
] | 1 | 2019-01-16T22:21:54.000Z | 2019-01-16T22:21:54.000Z | import pytest
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.linters import inputs
from galaxy.util import etree
NO_SECTIONS_XML = """
<tool name="BWA Mapper" id="bwa" version="1.0.1" is_multi_byte="true" display_interface="true" require_login="true" hidden="true">
<description>The BWA Mappe... | 39.731707 | 166 | 0.715163 | import pytest
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.linters import inputs
from galaxy.util import etree
NO_SECTIONS_XML = """
<tool name="BWA Mapper" id="bwa" version="1.0.1" is_multi_byte="true" display_interface="true" require_login="true" hidden="true">
<description>The BWA Mappe... | true | true |
f72ad5f44335464611bcb3461699a32b7602d505 | 7,802 | py | Python | virtual/lib/python3.6/site-packages/PIL/PsdImagePlugin.py | Ruterana/clone_instagram | a068587ef1d1a93ec8d1c08086bf11c0fb274b83 | [
"MIT"
] | 99 | 2019-10-09T16:14:46.000Z | 2022-03-17T02:23:47.000Z | virtual/lib/python3.6/site-packages/PIL/PsdImagePlugin.py | Ruterana/clone_instagram | a068587ef1d1a93ec8d1c08086bf11c0fb274b83 | [
"MIT"
] | 123 | 2019-09-10T14:48:01.000Z | 2019-11-28T21:24:06.000Z | virtual/lib/python3.6/site-packages/PIL/PsdImagePlugin.py | Ruterana/clone_instagram | a068587ef1d1a93ec8d1c08086bf11c0fb274b83 | [
"MIT"
] | 98 | 2019-10-17T14:48:28.000Z | 2022-01-21T03:33:38.000Z | #
# The Python Imaging Library
# $Id$
#
# Adobe PSD 2.5/3.0 file handling
#
# History:
# 1995-09-01 fl Created
# 1997-01-03 fl Read most PSD images
# 1997-01-18 fl Fixed P and CMYK support
# 2001-10-21 fl Added seek/tell support (for layers)
#
# Copyright (c) 1997-2001 by Secret Labs AB.
# Copyright (c) 1995-20... | 24.38125 | 81 | 0.481671 |
__version__ = "0.4"
import io
from . import Image, ImageFile, ImagePalette
from ._binary import i8, i16be as i16, i32be as i32
MODES = {
(0, 1): ("1", 1),
(0, 8): ("L", 1),
(1, 8): ("L", 1),
(2, 8): ("P", 1),
(3, 8): ("RGB", 3),
(4, 8): ("CMYK", 4),
(7, 8): ("L", 1), (8, 8): ("L... | true | true |
f72ad8ba1938d20c873989d306f99b76c1ee53bf | 11,515 | py | Python | qiskit/tools/jupyter/backend_overview.py | t-imamichi/qiskit-core | 8d2eeeac44f97af1e10514cdae4157e5923ff2e5 | [
"Apache-2.0"
] | 92 | 2018-06-05T11:18:38.000Z | 2018-07-01T23:50:44.000Z | qiskit/tools/jupyter/backend_overview.py | t-imamichi/qiskit-core | 8d2eeeac44f97af1e10514cdae4157e5923ff2e5 | [
"Apache-2.0"
] | 107 | 2018-06-05T08:41:19.000Z | 2018-07-02T12:10:53.000Z | qiskit/tools/jupyter/backend_overview.py | t-imamichi/qiskit-core | 8d2eeeac44f97af1e10514cdae4157e5923ff2e5 | [
"Apache-2.0"
] | 39 | 2018-06-05T09:55:56.000Z | 2018-07-02T08:47:35.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 35.650155 | 99 | 0.590881 |
import time
import threading
import types
from IPython.display import display
from IPython.core.magic import line_magic, Magics, magics_class
from IPython.core import magic_arguments
import matplotlib.pyplot as plt
import ipywidgets as widgets
from qiskit.tools.monitor.overview import get_unique_backends
from qiskit.... | true | true |
f72ada2ce523c5d4764bb97fbbec0c1d62c192e2 | 897 | py | Python | idaes/generic_models/unit_models/column_models/__init__.py | eslickj/idaes-pse | 328ed07ffb0b4d98c03e972675ea32c41dd2531a | [
"RSA-MD"
] | 112 | 2019-02-11T23:16:36.000Z | 2022-03-23T20:59:57.000Z | idaes/generic_models/unit_models/column_models/__init__.py | eslickj/idaes-pse | 328ed07ffb0b4d98c03e972675ea32c41dd2531a | [
"RSA-MD"
] | 621 | 2019-03-01T14:44:12.000Z | 2022-03-31T19:49:25.000Z | idaes/generic_models/unit_models/column_models/__init__.py | eslickj/idaes-pse | 328ed07ffb0b4d98c03e972675ea32c41dd2531a | [
"RSA-MD"
] | 154 | 2019-02-01T23:46:33.000Z | 2022-03-23T15:07:10.000Z | #################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | 52.764706 | 81 | 0.654404 | from .condenser import Condenser
from .reboiler import Reboiler
from .tray import Tray
from .tray_column import TrayColumn
| true | true |
f72adb7883b52f3f1c6bf8306f57b1dd0008ab29 | 868 | py | Python | enviorment/colors.py | JLMadsen/TetrisAI | c6f2ef47a57e60b1ec73666406931ca46c9d1233 | [
"MIT"
] | 1 | 2020-11-23T22:11:33.000Z | 2020-11-23T22:11:33.000Z | enviorment/colors.py | JLMadsen/TetrisAI | c6f2ef47a57e60b1ec73666406931ca46c9d1233 | [
"MIT"
] | 1 | 2021-07-13T15:31:00.000Z | 2021-07-13T15:31:00.000Z | enviorment/colors.py | JLMadsen/TetrisAI | c6f2ef47a57e60b1ec73666406931ca46c9d1233 | [
"MIT"
] | 1 | 2021-02-02T14:11:57.000Z | 2021-02-02T14:11:57.000Z | class Color:
WHITE = (255, 255, 255)
BLACK = (0, 0, 0 )
GRAY = (100, 100, 100)
RED = (220, 20, 60 )
GREEN = (50, 205, 50 )
YELLOW = (255, 255, 0 )
PURPLE = (218, 112, 214)
ALL = [WHITE, BLACK, GRAY, RED, GREEN]
# just for printing colors in terminal
class bcolo... | 22.842105 | 43 | 0.562212 | class Color:
WHITE = (255, 255, 255)
BLACK = (0, 0, 0 )
GRAY = (100, 100, 100)
RED = (220, 20, 60 )
GREEN = (50, 205, 50 )
YELLOW = (255, 255, 0 )
PURPLE = (218, 112, 214)
ALL = [WHITE, BLACK, GRAY, RED, GREEN]
class bcolors:
HEADER = '\033[95m'
OKBL... | true | true |
f72adc47d855b9bd8cfb880f4445828ea9fe2109 | 9,267 | py | Python | pysot/datasets/dataset_template.py | wattanapong/DFA | c05851beca2f8739f80531eb4de2f61639715cab | [
"Apache-2.0"
] | null | null | null | pysot/datasets/dataset_template.py | wattanapong/DFA | c05851beca2f8739f80531eb4de2f61639715cab | [
"Apache-2.0"
] | null | null | null | pysot/datasets/dataset_template.py | wattanapong/DFA | c05851beca2f8739f80531eb4de2f61639715cab | [
"Apache-2.0"
] | null | null | null | # Copyright (c) SenseTime. All Rights Reserved.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import logging
import sys
import os
import cv2
import numpy as np
from torch.utils.data import Dataset
from... | 34.449814 | 107 | 0.555627 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import logging
import sys
import os
import cv2
import numpy as np
from torch.utils.data import Dataset
from pysot.utils.bbox import center2corner, Center
f... | true | true |
f72addc1225c0aa169e2bb36069de6d370480522 | 12,614 | py | Python | src/gluonnlp/data/utils.py | yifeim/gluon-nlp | ea30d3399d87404b731d513535af9a31a5672799 | [
"Apache-2.0"
] | null | null | null | src/gluonnlp/data/utils.py | yifeim/gluon-nlp | ea30d3399d87404b731d513535af9a31a5672799 | [
"Apache-2.0"
] | 2 | 2019-02-13T09:10:26.000Z | 2019-02-20T02:59:43.000Z | src/gluonnlp/data/utils.py | yifeim/gluon-nlp | ea30d3399d87404b731d513535af9a31a5672799 | [
"Apache-2.0"
] | 1 | 2019-02-13T03:07:06.000Z | 2019-02-13T03:07:06.000Z | # coding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... | 30.616505 | 98 | 0.641589 |
from __future__ import absolute_import
from __future__ import print_function
__all__ = [
'Counter', 'count_tokens', 'concat_sequence', 'slice_sequence', 'train_valid_split',
'line_splitter', 'whitespace_splitter', 'Splitter'
]
import os
import collections
import zipfile
import tarfile
import numpy as np
fr... | true | true |
f72addc1825c766c27b5ea9433ca8b1b439ac3e5 | 33,419 | py | Python | cirq/ops/common_gates.py | philiptmassey/Cirq | b8b457c2fc484d76bf8a82a73f6ecc11756229a6 | [
"Apache-2.0"
] | null | null | null | cirq/ops/common_gates.py | philiptmassey/Cirq | b8b457c2fc484d76bf8a82a73f6ecc11756229a6 | [
"Apache-2.0"
] | null | null | null | cirq/ops/common_gates.py | philiptmassey/Cirq | b8b457c2fc484d76bf8a82a73f6ecc11756229a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 32.071977 | 80 | 0.552739 |
from typing import (
Any, Callable, cast, Iterable, List, Optional, Tuple, Union,
)
import numpy as np
from cirq import linalg, protocols, value
from cirq.ops import gate_features, eigen_gate, raw_types, gate_operation
from cirq.type_workarounds import NotImplementedType
import cirq.ops.phased_x_gate
class X... | true | true |
f72adde5fd070ac204654007f643a021dddeff3a | 4,967 | py | Python | sensirion_shdlc_sensorbridge/commands/firmware_update.py | Sensirion/python-shdlc-sensorbridge | c441c17d89697ecf0f7b61955f54c3da195e30e6 | [
"BSD-3-Clause"
] | null | null | null | sensirion_shdlc_sensorbridge/commands/firmware_update.py | Sensirion/python-shdlc-sensorbridge | c441c17d89697ecf0f7b61955f54c3da195e30e6 | [
"BSD-3-Clause"
] | 1 | 2021-03-28T22:15:29.000Z | 2021-11-03T09:06:14.000Z | sensirion_shdlc_sensorbridge/commands/firmware_update.py | Sensirion/python-shdlc-sensorbridge | c441c17d89697ecf0f7b61955f54c3da195e30e6 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# (c) Copyright 2020 Sensirion AG, Switzerland
##############################################################################
##############################################################################
# _____ _ _ _______ _____ ____ _ _
# / ____| ... | 35.733813 | 79 | 0.562915 |
from __future__ import absolute_import, division, print_function
from sensirion_shdlc_driver.command import ShdlcCommand
from struct import pack, unpack
import logging
log = logging.getLogger(__name__)
class SensorBridgeCmdFirmwareUpdateBase(ShdlcCommand):
def __init__(self, *args, **kwargs):
super(S... | true | true |
f72adf1f6af0532364f442d4ae606bac033e4b53 | 584 | py | Python | tutorials/migrations/0031_auto_20210211_1605.py | ericrobskyhuntley/vialab.mit.edu | 1318d03b8eeb106c1662052e1caa53290e206ae7 | [
"MIT"
] | null | null | null | tutorials/migrations/0031_auto_20210211_1605.py | ericrobskyhuntley/vialab.mit.edu | 1318d03b8eeb106c1662052e1caa53290e206ae7 | [
"MIT"
] | null | null | null | tutorials/migrations/0031_auto_20210211_1605.py | ericrobskyhuntley/vialab.mit.edu | 1318d03b8eeb106c1662052e1caa53290e206ae7 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2021-02-11 21:05
from django.db import migrations
import martor.models
class Migration(migrations.Migration):
dependencies = [
('tutorials', '0030_auto_20200408_1257'),
]
operations = [
migrations.AlterField(
model_name='historicalsoftware',
... | 23.36 | 60 | 0.601027 |
from django.db import migrations
import martor.models
class Migration(migrations.Migration):
dependencies = [
('tutorials', '0030_auto_20200408_1257'),
]
operations = [
migrations.AlterField(
model_name='historicalsoftware',
name='desc',
field=martor.... | true | true |
f72adfbd0b4913e9c0e119e52b6aa8237cc00b2a | 2,757 | py | Python | tools/count_opsize.py | VDIGPKU/OPANAS | 873ff09a65d3253ce8351e54880a642517f7e8b5 | [
"Apache-2.0"
] | 39 | 2021-03-31T21:15:48.000Z | 2022-03-30T03:34:14.000Z | tools/count_opsize.py | VDIGPKU/OPANAS | 873ff09a65d3253ce8351e54880a642517f7e8b5 | [
"Apache-2.0"
] | 8 | 2021-04-06T07:58:03.000Z | 2022-01-11T17:10:51.000Z | tools/count_opsize.py | VDIGPKU/OPANAS | 873ff09a65d3253ce8351e54880a642517f7e8b5 | [
"Apache-2.0"
] | 4 | 2021-04-06T03:28:56.000Z | 2022-03-06T19:57:50.000Z | import argparse
import os
import warnings
import mmcv
import torch
from mmcv import Config, DictAction
from mmcv.cnn import fuse_conv_bn
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import get_dist_info, init_dist, load_checkpoint
from mmcv.runner import (HOOKS, DistSamplerSeedH... | 31.689655 | 163 | 0.660863 | import argparse
import os
import warnings
import mmcv
import torch
from mmcv import Config, DictAction
from mmcv.cnn import fuse_conv_bn
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import get_dist_info, init_dist, load_checkpoint
from mmcv.runner import (HOOKS, DistSamplerSeedH... | true | true |
f72ae0a27f7cd75894571c6fa943dd5463f7ef49 | 15,394 | py | Python | tests/test_rtc_parse_aec.py | fyntex/lib-cl-sii-python | b6ffb72be1f173a1d2e44b17ae5c08caf96ebf34 | [
"MIT"
] | 8 | 2020-03-07T19:58:40.000Z | 2021-12-15T13:47:40.000Z | tests/test_rtc_parse_aec.py | fyntex/lib-cl-sii-python | b6ffb72be1f173a1d2e44b17ae5c08caf96ebf34 | [
"MIT"
] | 141 | 2020-01-17T22:47:35.000Z | 2022-03-31T18:29:47.000Z | tests/test_rtc_parse_aec.py | fyntex/lib-cl-sii-python | b6ffb72be1f173a1d2e44b17ae5c08caf96ebf34 | [
"MIT"
] | 3 | 2020-03-07T20:30:02.000Z | 2021-03-22T03:14:26.000Z | from __future__ import annotations
import unittest
from datetime import date, datetime
from cl_sii.dte.data_models import DteDataL1, DteXmlData
from cl_sii.dte.constants import TipoDteEnum
from cl_sii.dte.parse import DTE_XMLNS
from cl_sii.libs import encoding_utils
from cl_sii.libs import tz_utils
from cl_sii.libs i... | 44.235632 | 100 | 0.59023 | from __future__ import annotations
import unittest
from datetime import date, datetime
from cl_sii.dte.data_models import DteDataL1, DteXmlData
from cl_sii.dte.constants import TipoDteEnum
from cl_sii.dte.parse import DTE_XMLNS
from cl_sii.libs import encoding_utils
from cl_sii.libs import tz_utils
from cl_sii.libs i... | true | true |
f72ae161a0eb4e5d0974932d1ca4ef7364cf371f | 152 | py | Python | aiocloudflare/api/zones/dns_records/import_/import_.py | Stewart86/aioCloudflare | 341c0941f8f888a8b7e696e64550bce5da4949e6 | [
"MIT"
] | 2 | 2021-09-14T13:20:55.000Z | 2022-02-24T14:18:24.000Z | aiocloudflare/api/zones/dns_records/import_/import_.py | Stewart86/aioCloudflare | 341c0941f8f888a8b7e696e64550bce5da4949e6 | [
"MIT"
] | 46 | 2021-09-08T08:39:45.000Z | 2022-03-29T12:31:05.000Z | aiocloudflare/api/zones/dns_records/import_/import_.py | Stewart86/aioCloudflare | 341c0941f8f888a8b7e696e64550bce5da4949e6 | [
"MIT"
] | 1 | 2021-12-30T23:02:23.000Z | 2021-12-30T23:02:23.000Z | from aiocloudflare.commons.auth import Auth
class Import_(Auth):
_endpoint1 = "zones"
_endpoint2 = "dns_records/import"
_endpoint3 = None
| 19 | 43 | 0.723684 | from aiocloudflare.commons.auth import Auth
class Import_(Auth):
_endpoint1 = "zones"
_endpoint2 = "dns_records/import"
_endpoint3 = None
| true | true |
f72ae291978b1bc7fcf2a7bbfa465ce316156938 | 596 | py | Python | ROSpractice/src/topics_quiz/src/topics_quiz_node.py | kasiv008/Robotics | 302b3336005acd81202ebbbb0c52a4b2692fa9c7 | [
"MIT"
] | 1 | 2021-07-19T10:15:08.000Z | 2021-07-19T10:15:08.000Z | ROSpractice/src/topics_quiz/src/topics_quiz_node.py | kasiv008/Robotics | 302b3336005acd81202ebbbb0c52a4b2692fa9c7 | [
"MIT"
] | null | null | null | ROSpractice/src/topics_quiz/src/topics_quiz_node.py | kasiv008/Robotics | 302b3336005acd81202ebbbb0c52a4b2692fa9c7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
from sensor_msgs.msg import LaserScan
def callback(msg):
L,M,R = msg.ranges[719],msg.ranges[360],msg.ranges[0]
move.linear.x = .2
if M < 1.2:
move.linear.x = .05
move.angular.z = .1
elif L > 30 and R > 30 and M > 30:... | 24.833333 | 57 | 0.642617 | import rospy
from geometry_msgs.msg import Twist
from sensor_msgs.msg import LaserScan
def callback(msg):
L,M,R = msg.ranges[719],msg.ranges[360],msg.ranges[0]
move.linear.x = .2
if M < 1.2:
move.linear.x = .05
move.angular.z = .1
elif L > 30 and R > 30 and M > 30:
move.linear.x... | true | true |
f72ae3fa136caa90b5e27aab7455fdec4407560e | 2,016 | py | Python | alipay/aop/api/domain/KoubeiSalesKbassetStuffProduceqrcodeBatchqueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/KoubeiSalesKbassetStuffProduceqrcodeBatchqueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/KoubeiSalesKbassetStuffProduceqrcodeBatchqueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class KoubeiSalesKbassetStuffProduceqrcodeBatchqueryModel(object):
def __init__(self):
self._batch_id = None
self._page_size = None
self._produce_order_id = None
... | 28.394366 | 83 | 0.613095 | import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class KoubeiSalesKbassetStuffProduceqrcodeBatchqueryModel(object):
def __init__(self):
self._batch_id = None
self._page_size = None
self._produce_order_id = None
@property
def batch_id(self):
... | true | true |
f72ae4fe9cb98106976c818db916bbe6b063c51a | 2,243 | py | Python | sdk/python/tests/unit/test_feature_views.py | kevjumba/feast | 44d53fda71b5a82d9fb6e044b01d97080c2d018c | [
"Apache-2.0"
] | 810 | 2018-12-25T15:16:11.000Z | 2020-05-14T09:49:40.000Z | sdk/python/tests/unit/test_feature_views.py | kevjumba/feast | 44d53fda71b5a82d9fb6e044b01d97080c2d018c | [
"Apache-2.0"
] | 701 | 2018-12-21T05:18:43.000Z | 2020-05-16T01:30:21.000Z | sdk/python/tests/unit/test_feature_views.py | kevjumba/feast | 44d53fda71b5a82d9fb6e044b01d97080c2d018c | [
"Apache-2.0"
] | 155 | 2018-12-22T11:05:04.000Z | 2020-05-14T07:33:41.000Z | from datetime import timedelta
import pytest
from feast import PushSource
from feast.batch_feature_view import BatchFeatureView
from feast.data_format import AvroFormat
from feast.data_source import KafkaSource
from feast.infra.offline_stores.file_source import FileSource
from feast.stream_feature_view import StreamF... | 27.353659 | 79 | 0.628622 | from datetime import timedelta
import pytest
from feast import PushSource
from feast.batch_feature_view import BatchFeatureView
from feast.data_format import AvroFormat
from feast.data_source import KafkaSource
from feast.infra.offline_stores.file_source import FileSource
from feast.stream_feature_view import StreamF... | true | true |
f72ae59ecb83441e8b44b0616951c153ac6dd839 | 8,726 | py | Python | lambda/py/mutagen/_file.py | frivas/alexa-mixed-polly | bf0fde9005a66f3d6f0193799eacef934d166de7 | [
"W3C"
] | 2 | 2019-07-29T15:45:31.000Z | 2019-11-17T23:33:58.000Z | lambda/py/mutagen/_file.py | frivas/alexa-mixed-polly | bf0fde9005a66f3d6f0193799eacef934d166de7 | [
"W3C"
] | null | null | null | lambda/py/mutagen/_file.py | frivas/alexa-mixed-polly | bf0fde9005a66f3d6f0193799eacef934d166de7 | [
"W3C"
] | 1 | 2019-01-06T15:18:58.000Z | 2019-01-06T15:18:58.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2005 Michael Urman
#
# 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.
import wa... | 28.990033 | 79 | 0.607609 |
import warnings
from mutagen._util import DictMixin, loadfile
from mutagen._compat import izip
class FileType(DictMixin):
__module__ = "mutagen"
info = None
tags = None
filename = None
_mimes = ["application/octet-stream"]
def __init__(self, *args, **kwargs):
if not args and not k... | true | true |
f72ae5ad21d0d2e7c0cc825a649cff1858a27800 | 5,781 | py | Python | src/coolbeans/extort/ib.py | runarp/coolbeans | 128a7f2e45690d2d22b05608e555c44334f46859 | [
"MIT"
] | 5 | 2020-05-17T04:48:25.000Z | 2022-01-27T09:36:45.000Z | src/coolbeans/extort/ib.py | runarp/coolbeans | 128a7f2e45690d2d22b05608e555c44334f46859 | [
"MIT"
] | 1 | 2020-05-17T06:21:52.000Z | 2020-05-22T13:49:33.000Z | src/coolbeans/extort/ib.py | runarp/coolbeans | 128a7f2e45690d2d22b05608e555c44334f46859 | [
"MIT"
] | 1 | 2021-01-28T03:00:27.000Z | 2021-01-28T03:00:27.000Z | """Example Extorter, useful as a starting point"""
import typing
import logging
import dataclasses
import datetime
# 3rdparty
import slugify
# We use ibflex
from ibflex import parser, FlexStatement, CashAction
from coolbeans.extort.base import ExtortionProtocol
from coolbeans.tools.seeds import Trade, Transfer, E... | 33.034286 | 130 | 0.530877 |
import typing
import logging
import dataclasses
import datetime
import slugify
from ibflex import parser, FlexStatement, CashAction
from coolbeans.extort.base import ExtortionProtocol
from coolbeans.tools.seeds import Trade, Transfer, Expense, Income, EventDetail
logger = logging.getLogger(__name__)
def trade... | true | true |
f72ae5e176716f5b8b5bebf5ecd595df75c371dc | 1,555 | py | Python | example/run_SolveOneAgent_online.py | zehuilu/DrMaMP-Distributed-Real-time-Multi-agent-Mission-Planning-Algorithm | 894875ebddf7d1f6bbf7a47ce82f05d7be2bafdc | [
"Apache-2.0"
] | 4 | 2022-02-22T05:12:18.000Z | 2022-03-29T01:56:37.000Z | example/run_SolveOneAgent_online.py | zehuilu/DrMaMP-Distributed-Real-time-Multi-agent-Mission-Planning-Algorithm | 894875ebddf7d1f6bbf7a47ce82f05d7be2bafdc | [
"Apache-2.0"
] | null | null | null | example/run_SolveOneAgent_online.py | zehuilu/DrMaMP-Distributed-Real-time-Multi-agent-Mission-Planning-Algorithm | 894875ebddf7d1f6bbf7a47ce82f05d7be2bafdc | [
"Apache-2.0"
] | 3 | 2022-02-23T03:14:56.000Z | 2022-03-14T12:22:05.000Z | #!/usr/bin/env python3
import asyncio
import random
import matplotlib.pyplot as plt
import pathmagic
with pathmagic.context():
from Simulator import Simulator
from MissionPlanner import MissionPlanner
if __name__ == "__main__":
# define the world
map_width_meter = 25.0
map_height_meter = 25.0
... | 34.555556 | 104 | 0.686817 | import asyncio
import random
import matplotlib.pyplot as plt
import pathmagic
with pathmagic.context():
from Simulator import Simulator
from MissionPlanner import MissionPlanner
if __name__ == "__main__":
map_width_meter = 25.0
map_height_meter = 25.0
map_resolution = 2
value_non_obs = 0 ... | true | true |
f72ae622b3e7a87cfbd8de23dda483349b388bb1 | 26,682 | py | Python | test/functional/tests/io_class/test_io_classification.py | josehu07/open-cas-linux-mf | 5c6870be8bbb6816645955b6e479c9b5c7c0074d | [
"BSD-3-Clause-Clear"
] | 2 | 2021-08-13T14:44:45.000Z | 2022-01-10T07:41:40.000Z | test/functional/tests/io_class/test_io_classification.py | josehu07/open-cas-linux-mf | 5c6870be8bbb6816645955b6e479c9b5c7c0074d | [
"BSD-3-Clause-Clear"
] | null | null | null | test/functional/tests/io_class/test_io_classification.py | josehu07/open-cas-linux-mf | 5c6870be8bbb6816645955b6e479c9b5c7c0074d | [
"BSD-3-Clause-Clear"
] | null | null | null | #
# Copyright(c) 2019-2020 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import random
from itertools import permutations
import pytest
from api.cas.ioclass_config import IoClass
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
from test_tools import fs_utils
from test_to... | 39.296024 | 100 | 0.670227 |
import random
from itertools import permutations
import pytest
from api.cas.ioclass_config import IoClass
from storage_devices.disk import DiskType, DiskTypeSet, DiskTypeLowerThan
from test_tools import fs_utils
from test_tools.dd import Dd
from test_tools.disk_utils import Filesystem
from test_tools.fio.fio import ... | true | true |
f72ae69658ad2a7325bb00e82f738fd441ad6552 | 1,684 | py | Python | flask_controller/controller.py | AlexFence/FlaskController | efbd51a6970d407128f79876e8724b75fe6ec156 | [
"MIT"
] | 3 | 2020-10-19T08:18:51.000Z | 2022-02-06T04:29:38.000Z | flask_controller/controller.py | TypicalFence/FlaskController | efbd51a6970d407128f79876e8724b75fe6ec156 | [
"MIT"
] | null | null | null | flask_controller/controller.py | TypicalFence/FlaskController | efbd51a6970d407128f79876e8724b75fe6ec156 | [
"MIT"
] | null | null | null | from abc import ABC
def route(rule, **options):
"""Decorator for defining routes of FlaskController classes.
Acts in the same way ass @app.route.
Can be used for a class to set a base route too.
Args:
path (str): The path of the newly defined route
options: refer to flasks docs for t... | 28.066667 | 78 | 0.604513 | from abc import ABC
def route(rule, **options):
def decorator(f):
f._route = (rule, options)
return f
return decorator
class FlaskController(ABC):
def __init__(self):
super(FlaskController, self).__init__()
def register(self, app):
members = dir(self)
route... | true | true |
f72ae6adfbd9100ea1e159819c5e0ed61df33f44 | 24,028 | py | Python | windows_packages_gpu/torch/testing/_internal/jit_metaprogramming_utils.py | codeproject/DeepStack | d96368a3db1bc0266cb500ba3701d130834da0e6 | [
"Apache-2.0"
] | 353 | 2020-12-10T10:47:17.000Z | 2022-03-31T23:08:29.000Z | windows_packages_gpu/torch/testing/_internal/jit_metaprogramming_utils.py | codeproject/DeepStack | d96368a3db1bc0266cb500ba3701d130834da0e6 | [
"Apache-2.0"
] | 80 | 2020-12-10T09:54:22.000Z | 2022-03-30T22:08:45.000Z | windows_packages_gpu/torch/testing/_internal/jit_metaprogramming_utils.py | codeproject/DeepStack | d96368a3db1bc0266cb500ba3701d130834da0e6 | [
"Apache-2.0"
] | 63 | 2020-12-10T17:10:34.000Z | 2022-03-28T16:27:07.000Z | # Torch
from torch.jit.annotations import BroadcastingList2, BroadcastingList3 # noqa: F401
from torch.testing._internal.common_methods_invocations import non_differentiable, create_input, \
unpack_variables
import torch.nn.functional as F
import torch
import torch.cuda
import torch.jit
import torch.jit._l... | 44.91215 | 125 | 0.579657 | from torch.jit.annotations import BroadcastingList2, BroadcastingList3 from torch.testing._internal.common_methods_invocations import non_differentiable, create_input, \
unpack_variables
import torch.nn.functional as F
import torch
import torch.cuda
import torch.jit
import torch.jit._logging
import torch.ji... | true | true |
f72ae77f6af21241e139bcfcb73ffd4cb6993215 | 566 | py | Python | setup.py | galperins4/python-client | c8b6ea1f33801254eb560429b2c775d10fe60273 | [
"MIT"
] | 1 | 2018-06-15T11:19:23.000Z | 2018-06-15T11:19:23.000Z | setup.py | galperins4/mirror-python-client | c8b6ea1f33801254eb560429b2c775d10fe60273 | [
"MIT"
] | null | null | null | setup.py | galperins4/mirror-python-client | c8b6ea1f33801254eb560429b2c775d10fe60273 | [
"MIT"
] | null | null | null | import sys
import setuptools
requires = [
'requests>=2.19.1',
'backoff>=1.6.0',
'flatten_dict>=0.3.0'
]
tests_require = []
extras_require = {}
setuptools.setup(
name='hedera-python-client',
description='Python API client for Hedera Hashgraph.',
version='0.0.1',
author='TBD',
author... | 20.214286 | 68 | 0.676678 | import sys
import setuptools
requires = [
'requests>=2.19.1',
'backoff>=1.6.0',
'flatten_dict>=0.3.0'
]
tests_require = []
extras_require = {}
setuptools.setup(
name='hedera-python-client',
description='Python API client for Hedera Hashgraph.',
version='0.0.1',
author='TBD',
author... | true | true |
f72ae7e848291c51786e5d2a992f0c9c85761179 | 7,832 | py | Python | plugins/modules/oci_object_storage_replication_policy_facts.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_object_storage_replication_policy_facts.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_object_storage_replication_policy_facts.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 32.633333 | 122 | 0.655388 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_object_storage_replication_policy_facts
short_description: Fetches details abou... | true | true |
f72ae8822be3a2b344c2b3ee4a5a5f5d65da61a6 | 3,218 | py | Python | NTP_Bot/msg_interpreter.py | PEI-I1/Nos_Tech_Problems | cf8b0b51285a912988a96cc96438f81c75fa45b7 | [
"MIT"
] | null | null | null | NTP_Bot/msg_interpreter.py | PEI-I1/Nos_Tech_Problems | cf8b0b51285a912988a96cc96438f81c75fa45b7 | [
"MIT"
] | 14 | 2020-06-05T20:19:18.000Z | 2021-09-22T18:18:23.000Z | NTP_Bot/msg_interpreter.py | PEI-I1/Nos_Tech_Problems | cf8b0b51285a912988a96cc96438f81c75fa45b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import tensorflow_hub as hub
import numpy as np
import tensorflow_text
import json, re, os
from threading import Thread
from keywords import keywords
embeddings = {}
embed = None
def loadModelData():
''' Loads Tensorflow enconder and pre-encodes the problem data
'''
global embed
... | 37.858824 | 112 | 0.720945 | import tensorflow_hub as hub
import numpy as np
import tensorflow_text
import json, re, os
from threading import Thread
from keywords import keywords
embeddings = {}
embed = None
def loadModelData():
global embed
global embeddings
embed = hub.load("https://tfhub.dev/google/universal-sentence-encoder-mult... | true | true |
f72ae89046ac8b319ed71a62b07e68d530306531 | 3,901 | py | Python | powerwatch/analysis/old_analysis_scripts/average_time_pw_uplug.py | nklugman/PlugWatch | 4fbd2506a6808542fc5246e87d3c382761da1eaf | [
"MIT"
] | null | null | null | powerwatch/analysis/old_analysis_scripts/average_time_pw_uplug.py | nklugman/PlugWatch | 4fbd2506a6808542fc5246e87d3c382761da1eaf | [
"MIT"
] | null | null | null | powerwatch/analysis/old_analysis_scripts/average_time_pw_uplug.py | nklugman/PlugWatch | 4fbd2506a6808542fc5246e87d3c382761da1eaf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, window, asc, desc, lead, lag, udf, hour
from pyspark.sql.functions import month, year, lit, when, collect_list, struct, mean, stddev, stddev_pop
import pyspark.sql.functions as F
from pyspark.sql.window import Window
from ... | 40.216495 | 162 | 0.722892 | from pyspark.sql import SparkSession
from pyspark.sql.functions import col, window, asc, desc, lead, lag, udf, hour
from pyspark.sql.functions import month, year, lit, when, collect_list, struct, mean, stddev, stddev_pop
import pyspark.sql.functions as F
from pyspark.sql.window import Window
from pyspark.sql.types impo... | true | true |
f72ae8f83fbcedd3eb02039ff2317a6935549fc8 | 5,975 | py | Python | lightlab/equipment/visa_bases/driver_base.py | CharLee674/rvisa_lightlab | b43e36f3436b60c8c5f3088b4cb0896c5360aa4a | [
"MIT"
] | null | null | null | lightlab/equipment/visa_bases/driver_base.py | CharLee674/rvisa_lightlab | b43e36f3436b60c8c5f3088b4cb0896c5360aa4a | [
"MIT"
] | null | null | null | lightlab/equipment/visa_bases/driver_base.py | CharLee674/rvisa_lightlab | b43e36f3436b60c8c5f3088b4cb0896c5360aa4a | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from contextlib import contextmanager
import socket
import time
from lightlab import visalogger as logger
from rvisa.util import from_ascii_block
class InstrumentSessionBase(ABC):
''' Base class for Instrument sessions, to be inherited and specialized
by VISAObject and Prol... | 29.146341 | 110 | 0.594979 | from abc import ABC, abstractmethod
from contextlib import contextmanager
import socket
import time
from lightlab import visalogger as logger
from rvisa.util import from_ascii_block
class InstrumentSessionBase(ABC):
@abstractmethod
def spoll(self):
pass
@abstractmethod
def LLO(self):
... | true | true |
f72ae943e83fcbed48d9e3f084fe924867622c96 | 2,382 | py | Python | simple_ado/user.py | Bhaskers-Blu-Org2/simple_ado | bbfb1cd5d513cce0f606188e803db3dcf667cb75 | [
"MIT"
] | null | null | null | simple_ado/user.py | Bhaskers-Blu-Org2/simple_ado | bbfb1cd5d513cce0f606188e803db3dcf667cb75 | [
"MIT"
] | null | null | null | simple_ado/user.py | Bhaskers-Blu-Org2/simple_ado | bbfb1cd5d513cce0f606188e803db3dcf667cb75 | [
"MIT"
] | 1 | 2020-07-30T13:18:16.000Z | 2020-07-30T13:18:16.000Z | #!/usr/bin/env python3
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""ADO user API wrapper."""
import logging
from typing import cast
from simple_ado.base_client import ADOBaseClient
from simple_ado.context import ADOContext
from simple_ado.exceptions import ADOException
from simple_ado... | 35.552239 | 110 | 0.670025 |
import logging
from typing import cast
from simple_ado.base_client import ADOBaseClient
from simple_ado.context import ADOContext
from simple_ado.exceptions import ADOException
from simple_ado.http_client import ADOHTTPClient
from simple_ado.types import TeamFoundationId
class ADOUserClient(ADOBaseClient):
d... | true | true |
f72aea0d6cc0cce475a487b99abf5840a183729c | 152 | py | Python | controller/apps.py | skyrred/Gestion | c38c4d1fa229f5b0e0ef2667ff98864a28dc3241 | [
"Apache-2.0"
] | 1 | 2021-11-15T14:55:36.000Z | 2021-11-15T14:55:36.000Z | controller/apps.py | skyrred/Gestion | c38c4d1fa229f5b0e0ef2667ff98864a28dc3241 | [
"Apache-2.0"
] | null | null | null | controller/apps.py | skyrred/Gestion | c38c4d1fa229f5b0e0ef2667ff98864a28dc3241 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class ControllerConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'controller'
| 21.714286 | 56 | 0.769737 | from django.apps import AppConfig
class ControllerConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'controller'
| true | true |
f72aeafc60f1c50f2b50e3c33dc739dfa7cb4e8a | 1,675 | py | Python | opening2d.py | Nobu575/AppItk | 91de313115b753a6fb1ae67f53d4979580ef768b | [
"MIT"
] | null | null | null | opening2d.py | Nobu575/AppItk | 91de313115b753a6fb1ae67f53d4979580ef768b | [
"MIT"
] | null | null | null | opening2d.py | Nobu575/AppItk | 91de313115b753a6fb1ae67f53d4979580ef768b | [
"MIT"
] | null | null | null | import numpy as np
import itk
import matplotlib.pyplot as plt
# Input file name
input_filename = './jenga_g_150.png'
# Set dimension
Dimension = 2
# Read input image
itk_image = itk.imread(input_filename)
# Setting for input image (Grayscale)
InputPixelType = itk.UC
InputImageType = itk.Image[InputPixelType, Dimens... | 33.5 | 102 | 0.819104 | import numpy as np
import itk
import matplotlib.pyplot as plt
input_filename = './jenga_g_150.png'
Dimension = 2
itk_image = itk.imread(input_filename)
InputPixelType = itk.UC
InputImageType = itk.Image[InputPixelType, Dimension]
reader = itk.ImageFileReader[InputImageType].New()
reader.SetFileName(input_filename)... | true | true |
f72aed1738f6ccb62f4bf6aeaaf1bcc63b40247b | 2,587 | py | Python | update.py | boost/bucket-antivirus-function | 6eb93406e28f81a4c612f0dec29670451e0c5589 | [
"Apache-2.0"
] | null | null | null | update.py | boost/bucket-antivirus-function | 6eb93406e28f81a4c612f0dec29670451e0c5589 | [
"Apache-2.0"
] | null | null | null | update.py | boost/bucket-antivirus-function | 6eb93406e28f81a4c612f0dec29670451e0c5589 | [
"Apache-2.0"
] | 1 | 2020-07-16T12:47:24.000Z | 2020-07-16T12:47:24.000Z | # -*- coding: utf-8 -*-
# Upside Travel, 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... | 39.8 | 87 | 0.719366 |
import os
import boto3
import clamav
from common import AV_DEFINITION_PATH
from common import AV_DEFINITION_S3_BUCKET
from common import AV_DEFINITION_S3_PREFIX
from common import CLAMAVLIB_PATH
from common import get_timestamp
import shutil
def lambda_handler(event, context):
s3 = boto3.resource("s3")
s3_... | true | true |
f72aeddbd79707ad743350eba5e76f34ba47af5c | 15,728 | py | Python | ssd.py | tristanmooo/ssd_keras | e4be1dae086e91a81b020787f94560836379dc68 | [
"MIT"
] | null | null | null | ssd.py | tristanmooo/ssd_keras | e4be1dae086e91a81b020787f94560836379dc68 | [
"MIT"
] | null | null | null | ssd.py | tristanmooo/ssd_keras | e4be1dae086e91a81b020787f94560836379dc68 | [
"MIT"
] | null | null | null | """Keras implementation of SSD."""
import keras.backend as K
from keras.layers import Activation
from keras.layers import AtrousConvolution2D
from keras.layers import Convolution2D
from keras.layers import Dense
from keras.layers import Flatten
from keras.layers import GlobalAveragePooling2D
from keras.layers import I... | 51.398693 | 127 | 0.532363 |
import keras.backend as K
from keras.layers import Activation
from keras.layers import AtrousConvolution2D
from keras.layers import Convolution2D
from keras.layers import Dense
from keras.layers import Flatten
from keras.layers import GlobalAveragePooling2D
from keras.layers import Input
from keras.layers import MaxPo... | true | true |
f72aedf20d5a4dd130832d24767e5a8c5c2c559a | 850 | py | Python | test/record/parser/test_response_whois_nic_ve_property_nameservers_missing.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null | test/record/parser/test_response_whois_nic_ve_property_nameservers_missing.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null | test/record/parser/test_response_whois_nic_ve_property_nameservers_missing.py | huyphan/pyyawhois | 77fb2f73a9c67989f1d41d98f37037406a69d136 | [
"MIT"
] | null | null | null |
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# spec/fixtures/responses/whois.nic.ve/property_nameservers_missing
#
# and regenerate the tests with the following script
#
# $ scripts/generate_tests.py
#
from nose.tools import *
from dateutil.parser im... | 31.481481 | 94 | 0.711765 |
from nose.tools import *
from dateutil.parser import parse as time_parse
import yawhois
class TestWhoisNicVePropertyNameserversMissing(object):
def setUp(self):
fixture_path = "spec/fixtures/responses/whois.nic.ve/property_nameservers_missing.txt"
host = "whois.nic.ve"
part ... | true | true |
f72aee673e41aaa5710037678b883636f5df28d7 | 7,947 | py | Python | src/python/pants/backend/python/lint/pylint/rules.py | danxmoran/pants | 7fafd7d789747c9e6a266847a0ccce92c3fa0754 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/lint/pylint/rules.py | danxmoran/pants | 7fafd7d789747c9e6a266847a0ccce92c3fa0754 | [
"Apache-2.0"
] | 22 | 2022-01-27T09:59:50.000Z | 2022-03-30T07:06:49.000Z | src/python/pants/backend/python/lint/pylint/rules.py | danxmoran/pants | 7fafd7d789747c9e6a266847a0ccce92c3fa0754 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
from dataclasses import dataclass
from typing import Tuple
from pants.backend.python.lint.pylint.subsystem import (
Pylint,
PylintFieldSet,
... | 35.959276 | 100 | 0.707059 |
from __future__ import annotations
from dataclasses import dataclass
from typing import Tuple
from pants.backend.python.lint.pylint.subsystem import (
Pylint,
PylintFieldSet,
PylintFirstPartyPlugins,
)
from pants.backend.python.subsystems.setup import PythonSetup
from pants.backend.python.util_rules impo... | true | true |
f72aef2c46434bd7fee98942b7dd5f4091b26225 | 9,102 | py | Python | homeassistant/components/philips_js/media_player.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 6 | 2020-07-18T16:33:25.000Z | 2021-09-26T09:52:04.000Z | homeassistant/components/philips_js/media_player.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 47 | 2020-07-23T07:14:33.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/philips_js/media_player.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """Media Player component to integrate TVs exposing the Joint Space API."""
from datetime import timedelta
import logging
from haphilipsjs import PhilipsTV
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassistant.components.media_player.const imp... | 30.854237 | 88 | 0.64777 | from datetime import timedelta
import logging
from haphilipsjs import PhilipsTV
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_CHANNEL,
SUPPORT_NEXT_TRACK,
SUPPORT_PLAY_MEDIA... | true | true |
f72aef7afd8a21811ad53f8b289714ccd5098693 | 8,333 | py | Python | genie/assay.py | veo-ibd/Genie | 735e3aa0dc71aab0c404fd0cb3a34c8e1d9784c2 | [
"MIT"
] | null | null | null | genie/assay.py | veo-ibd/Genie | 735e3aa0dc71aab0c404fd0cb3a34c8e1d9784c2 | [
"MIT"
] | null | null | null | genie/assay.py | veo-ibd/Genie | 735e3aa0dc71aab0c404fd0cb3a34c8e1d9784c2 | [
"MIT"
] | 1 | 2022-01-20T16:33:19.000Z | 2022-01-20T16:33:19.000Z | import os
import logging
import subprocess
import yaml
import pandas as pd
from .example_filetype_format import FileTypeFormat
from . import process_functions
logger = logging.getLogger(__name__)
class Assayinfo(FileTypeFormat):
'''
Assay information file type
'''
_fileType = "assayinfo"
_proc... | 36.388646 | 89 | 0.582503 | import os
import logging
import subprocess
import yaml
import pandas as pd
from .example_filetype_format import FileTypeFormat
from . import process_functions
logger = logging.getLogger(__name__)
class Assayinfo(FileTypeFormat):
_fileType = "assayinfo"
_process_kwargs = ["newPath", "databaseSynId"]
d... | true | true |
f72af06f509cb3b16be313e070fe087431a96b9c | 1,550 | py | Python | dlfairness/other/get_weight/alm.py | lin-tan/fairness-variance | 7f6aee23160707ffe78f429e5d960022ea1c9fe4 | [
"BSD-3-Clause"
] | null | null | null | dlfairness/other/get_weight/alm.py | lin-tan/fairness-variance | 7f6aee23160707ffe78f429e5d960022ea1c9fe4 | [
"BSD-3-Clause"
] | null | null | null | dlfairness/other/get_weight/alm.py | lin-tan/fairness-variance | 7f6aee23160707ffe78f429e5d960022ea1c9fe4 | [
"BSD-3-Clause"
] | null | null | null | import argparse
import pandas as pd
import json
import pickle
import numpy as np
from pathlib import Path
from scipy.special import softmax
import shutil
parser = argparse.ArgumentParser()
parser.add_argument('--config', type=str)
parser.add_argument('--raw_result_dir', type=str)
parser.add_argument('--output_dir', ty... | 35.227273 | 124 | 0.570323 | import argparse
import pandas as pd
import json
import pickle
import numpy as np
from pathlib import Path
from scipy.special import softmax
import shutil
parser = argparse.ArgumentParser()
parser.add_argument('--config', type=str)
parser.add_argument('--raw_result_dir', type=str)
parser.add_argument('--output_dir', ty... | true | true |
f72af113f201219d494c2ae51b9d0c0fae085aeb | 925 | py | Python | Codefights/arcade/intro/level-7/33.stringsRearrangement/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codefights/arcade/intro/level-7/33.stringsRearrangement/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codefights/arcade/intro/level-7/33.stringsRearrangement/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python3
def diffOne(a, b):
count = 0
for i in range(len(a)):
if a[i] != b[i]:
count += 1
if count == 2:
return False
return bool(count)
def func(inputArray, curr):
if len(inputArray) == 1:
return diffOne(inputArray[0], curr)
for i in range(len(inpu... | 30.833333 | 73 | 0.572973 |
def diffOne(a, b):
count = 0
for i in range(len(a)):
if a[i] != b[i]:
count += 1
if count == 2:
return False
return bool(count)
def func(inputArray, curr):
if len(inputArray) == 1:
return diffOne(inputArray[0], curr)
for i in range(len(inputArray)):
... | true | true |
f72af114783cb0a76af49c20e78ca72551409642 | 1,378 | py | Python | setup.py | jamesgregson/easy_image_io | 4b5af29f3ccc37e4b10fbdc1e18d508ed04b882d | [
"MIT"
] | 1 | 2017-08-17T11:59:45.000Z | 2017-08-17T11:59:45.000Z | setup.py | jamesgregson/easy_image_io | 4b5af29f3ccc37e4b10fbdc1e18d508ed04b882d | [
"MIT"
] | null | null | null | setup.py | jamesgregson/easy_image_io | 4b5af29f3ccc37e4b10fbdc1e18d508ed04b882d | [
"MIT"
] | null | null | null | from setuptools import setup, Extension
import numpy
import os
import config
def find(name, path):
for root, dirs, files in os.walk(path):
if name in files:
return os.path.join(root, name)
return '';
print('locating directories...')
defines = [ ('MAJOR_VERSION',0),('MINOR_VERSION',1) ... | 30.622222 | 74 | 0.650218 | from setuptools import setup, Extension
import numpy
import os
import config
def find(name, path):
for root, dirs, files in os.walk(path):
if name in files:
return os.path.join(root, name)
return '';
print('locating directories...')
defines = [ ('MAJOR_VERSION',0),('MINOR_VERSION',1) ... | true | true |
f72af1e60284b4758cddcb59383f494df80a1a1a | 148,700 | py | Python | all/emojitations/data/hy.py | idleberg/sublime-emojitations | b2b4e8ce2c33ed0f6b8d6db6085e21da4e8d895b | [
"MIT"
] | 6 | 2016-08-31T14:42:36.000Z | 2021-09-05T23:55:47.000Z | all/emojitations/data/hy.py | idleberg/sublime-emojitations | b2b4e8ce2c33ed0f6b8d6db6085e21da4e8d895b | [
"MIT"
] | 1 | 2016-10-20T10:52:06.000Z | 2016-10-20T18:47:19.000Z | all/emojitations/data/hy.py | idleberg/sublime-emojitations | b2b4e8ce2c33ed0f6b8d6db6085e21da4e8d895b | [
"MIT"
] | 5 | 2016-08-31T14:48:11.000Z | 2021-09-05T23:55:33.000Z | from emojitations.emojitypes import EmojiAnnotations
emoji = [
EmojiAnnotations(emoji='😀', codepoints=(128512,), name='ծիծաղող դեմք', slug='ծիծաղող_դեմք', annotations=frozenset({'դեմք', 'քմծիծաղել'})),
EmojiAnnotations(emoji='😁', codepoints=(128513,), name='ծիծաղող դեմք ժպտացող աչքերով', slug='ծիծաղող_դեմք_ժպտացո... | 154.573805 | 252 | 0.714472 | from emojitations.emojitypes import EmojiAnnotations
emoji = [
EmojiAnnotations(emoji='😀', codepoints=(128512,), name='ծիծաղող դեմք', slug='ծիծաղող_դեմք', annotations=frozenset({'դեմք', 'քմծիծաղել'})),
EmojiAnnotations(emoji='😁', codepoints=(128513,), name='ծիծաղող դեմք ժպտացող աչքերով', slug='ծիծաղող_դեմք_ժպտացո... | true | true |
f72af208934e1a6893d8de9bece97fef4e04f823 | 68,824 | py | Python | spec/API_specification/array_api/elementwise_functions.py | oleksandr-pavlyk/array-api | 34aa9251bec8e53d8e7f4330f0b2b6221b3f6dcb | [
"MIT"
] | null | null | null | spec/API_specification/array_api/elementwise_functions.py | oleksandr-pavlyk/array-api | 34aa9251bec8e53d8e7f4330f0b2b6221b3f6dcb | [
"MIT"
] | null | null | null | spec/API_specification/array_api/elementwise_functions.py | oleksandr-pavlyk/array-api | 34aa9251bec8e53d8e7f4330f0b2b6221b3f6dcb | [
"MIT"
] | null | null | null | from ._types import array
def abs(x: array, /) -> array:
"""
Calculates the absolute value for each element ``x_i`` of the input array ``x`` (i.e., the element-wise result has the same magnitude as the respective element in ``x`` but has positive sign).
.. note::
For signed integer data types, the ... | 49.407035 | 614 | 0.621527 | from ._types import array
def abs(x: array, /) -> array:
def acos(x: array, /) -> array:
def acosh(x: array, /) -> array:
def add(x1: array, x2: array, /) -> array:
def asin(x: array, /) -> array:
def asinh(x: array, /) -> array:
def atan(x: array, /) -> array:
def atan2(x1: array, x2: array, /) -> array:
def ... | true | true |
f72af3b77a6c41b7fa62f8cf773835380670f57a | 130 | py | Python | cwlkernel/__main__.py | codacy-badger/CWLJNIKernel | 89c830d2ab300f3775e4e49cfc2d0fe894170f5e | [
"Apache-2.0"
] | null | null | null | cwlkernel/__main__.py | codacy-badger/CWLJNIKernel | 89c830d2ab300f3775e4e49cfc2d0fe894170f5e | [
"Apache-2.0"
] | null | null | null | cwlkernel/__main__.py | codacy-badger/CWLJNIKernel | 89c830d2ab300f3775e4e49cfc2d0fe894170f5e | [
"Apache-2.0"
] | null | null | null | from ipykernel.kernelapp import IPKernelApp
from .CWLKernel import CWLKernel
IPKernelApp.launch_instance(kernel_class=CWLKernel) | 26 | 51 | 0.876923 | from ipykernel.kernelapp import IPKernelApp
from .CWLKernel import CWLKernel
IPKernelApp.launch_instance(kernel_class=CWLKernel) | true | true |
f72af4bbb77cd40f08c0addf4a50faf422264aa8 | 7,875 | py | Python | TorchRay/torchray/benchmark/evaluate_imagenet_gradcam_energy_inside_bbox.py | UMBCvision/Consistent-Explanations-by-Contrastive-Learning | 589ff89cbcc96a1d8bd8d5b7bd7a785448ed2de3 | [
"MIT"
] | null | null | null | TorchRay/torchray/benchmark/evaluate_imagenet_gradcam_energy_inside_bbox.py | UMBCvision/Consistent-Explanations-by-Contrastive-Learning | 589ff89cbcc96a1d8bd8d5b7bd7a785448ed2de3 | [
"MIT"
] | null | null | null | TorchRay/torchray/benchmark/evaluate_imagenet_gradcam_energy_inside_bbox.py | UMBCvision/Consistent-Explanations-by-Contrastive-Learning | 589ff89cbcc96a1d8bd8d5b7bd7a785448ed2de3 | [
"MIT"
] | null | null | null | import argparse
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data.distributed
import torchvision.transforms as transforms
import resnet_multigpu_cgc as resnet
import cv2
import datasets as pointing_d... | 36.971831 | 112 | 0.616381 | import argparse
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data.distributed
import torchvision.transforms as transforms
import resnet_multigpu_cgc as resnet
import cv2
import datasets as pointing_d... | true | true |
f72af5153bd9f88566e3d6863c7c6bad63faba5c | 558 | py | Python | var_global_local.py | Spy142/python_lesson_4 | 1539576301c2bf61be803be7846c9278f350a0f3 | [
"MIT"
] | null | null | null | var_global_local.py | Spy142/python_lesson_4 | 1539576301c2bf61be803be7846c9278f350a0f3 | [
"MIT"
] | null | null | null | var_global_local.py | Spy142/python_lesson_4 | 1539576301c2bf61be803be7846c9278f350a0f3 | [
"MIT"
] | 1 | 2020-09-09T09:27:06.000Z | 2020-09-09T09:27:06.000Z | global_var = 10
def function_example(local_var_1, local_var_2):
print(local_var_1, local_var_2, global_var)
function_example(11, 12)
def function_example_1(local_var_1, local_var_2):
global global_var
global_var = 20
print(local_var_1, local_var_2, global_var, id(global_var))
function_example_1(11... | 16.909091 | 63 | 0.702509 | global_var = 10
def function_example(local_var_1, local_var_2):
print(local_var_1, local_var_2, global_var)
function_example(11, 12)
def function_example_1(local_var_1, local_var_2):
global global_var
global_var = 20
print(local_var_1, local_var_2, global_var, id(global_var))
function_example_1(11... | true | true |
f72af6a3f7871c38684b0e461069b71876226a9b | 157 | py | Python | tests/model_control/detailed/transf_None/model_control_one_enabled_None_MovingAverage_Seasonal_Second_MLP.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/model_control/detailed/transf_None/model_control_one_enabled_None_MovingAverage_Seasonal_Second_MLP.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/model_control/detailed/transf_None/model_control_one_enabled_None_MovingAverage_Seasonal_Second_MLP.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['MovingAverage'] , ['Seasonal_Second'] , ['MLP'] ); | 39.25 | 84 | 0.751592 | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['MovingAverage'] , ['Seasonal_Second'] , ['MLP'] ); | true | true |
f72af6e888f158710810a4b5ed837ab592f4f7f4 | 3,251 | py | Python | tests/toolkit/utils.py | Devtography/ibpy_native | e3e2a406a8db9bb338953be6dc195b8099379acb | [
"Apache-2.0"
] | 6 | 2020-07-09T20:55:41.000Z | 2022-01-22T15:43:29.000Z | tests/toolkit/utils.py | Devtography/ibpy_native | e3e2a406a8db9bb338953be6dc195b8099379acb | [
"Apache-2.0"
] | 1 | 2021-02-28T13:37:43.000Z | 2021-02-28T13:37:43.000Z | tests/toolkit/utils.py | Devtography/ibpy_native | e3e2a406a8db9bb338953be6dc195b8099379acb | [
"Apache-2.0"
] | 5 | 2020-05-24T19:15:06.000Z | 2022-01-22T15:43:35.000Z | """Utilities for making unittests easier to write."""
# pylint: disable=protected-access
import asyncio
import os
import queue
from typing import Dict, List, Optional, Union
from ibapi import wrapper
from ibpy_native import error
from ibpy_native import models
from ibpy_native.interfaces import delegates
from ibpy_na... | 30.669811 | 77 | 0.671486 | import asyncio
import os
import queue
from typing import Dict, List, Optional, Union
from ibapi import wrapper
from ibpy_native import error
from ibpy_native import models
from ibpy_native.interfaces import delegates
from ibpy_native.interfaces import listeners
from ibpy_native.utils import finishable_queue as fq
de... | true | true |
f72af7d6e7b04db16a0baa10f553c130371e0a1e | 1,561 | py | Python | __scraping__/comics.panini.it - scrapy/main-itemloader.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | __scraping__/comics.panini.it - scrapy/main-itemloader.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | __scraping__/comics.panini.it - scrapy/main-itemloader.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z | #!/usr/bin/env python3
# date: 2019.08.06
# https://stackoverflow.com/questions/57366488/how-to-pass-the-single-link-in-a-nested-url-scrape
import scrapy
from scrapy.loader import ItemLoader
from scrapy.loader.processors import MapCompose
def clean(text):
text = text.replace('\xa0', ' ')
text = text.strip().... | 31.22 | 118 | 0.643177 |
import scrapy
from scrapy.loader import ItemLoader
from scrapy.loader.processors import MapCompose
def clean(text):
text = text.replace('\xa0', ' ')
text = text.strip().split('\n')
text = ' '.join(x.strip() for x in text)
return text
class ComicscraperItem(scrapy.Item):
title = scrapy.Field(inpu... | true | true |
f72af7e4a722a6457a4e5bb9862634b05fb4b74c | 3,915 | py | Python | sendSMSSkillLambda/package/ask_sdk_model/interfaces/geolocation/altitude.py | shneydor/aws-alexa-lambda-workshop | 0fa6b7067b04fc85c46b9ce1c2cc04554ed5baf4 | [
"Apache-2.0"
] | null | null | null | sendSMSSkillLambda/package/ask_sdk_model/interfaces/geolocation/altitude.py | shneydor/aws-alexa-lambda-workshop | 0fa6b7067b04fc85c46b9ce1c2cc04554ed5baf4 | [
"Apache-2.0"
] | null | null | null | sendSMSSkillLambda/package/ask_sdk_model/interfaces/geolocation/altitude.py | shneydor/aws-alexa-lambda-workshop | 0fa6b7067b04fc85c46b9ce1c2cc04554ed5baf4 | [
"Apache-2.0"
] | 1 | 2019-10-11T17:15:20.000Z | 2019-10-11T17:15:20.000Z | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 34.043478 | 108 | 0.61507 |
import pprint
import re import six
import typing
from enum import Enum
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union
from datetime import datetime
class Altitude(object):
deserialized_types = {
'altitude_in_meters': 'float',
'accuracy_in_meters': 'float'
... | true | true |
f72af7f234a3a7aaf0e57fc752f62d4dd0d648af | 38 | py | Python | frontend/GUI/ROOT_AND_MAIN/USER_WINDOW/USER_FRAME/callbacks.py | Lucianofc138/smart_scheduler_usm | 0ac50d71cfd1947b889a9551c31a3a67ecabfb88 | [
"MIT"
] | null | null | null | frontend/GUI/ROOT_AND_MAIN/USER_WINDOW/USER_FRAME/callbacks.py | Lucianofc138/smart_scheduler_usm | 0ac50d71cfd1947b889a9551c31a3a67ecabfb88 | [
"MIT"
] | null | null | null | frontend/GUI/ROOT_AND_MAIN/USER_WINDOW/USER_FRAME/callbacks.py | Lucianofc138/smart_scheduler_usm | 0ac50d71cfd1947b889a9551c31a3a67ecabfb88 | [
"MIT"
] | null | null | null | def new_user(user_stringvar):
pass | 19 | 29 | 0.763158 | def new_user(user_stringvar):
pass | true | true |
f72af8f3d31d026bd4517c8b3a0509701311dff5 | 4,016 | py | Python | netmiko/exercise4.py | Tes3awy/DevNet-DC | 03b4c7dc82221943bc25d0ab9d74ee2697fcc34c | [
"MIT"
] | null | null | null | netmiko/exercise4.py | Tes3awy/DevNet-DC | 03b4c7dc82221943bc25d0ab9d74ee2697fcc34c | [
"MIT"
] | null | null | null | netmiko/exercise4.py | Tes3awy/DevNet-DC | 03b4c7dc82221943bc25d0ab9d74ee2697fcc34c | [
"MIT"
] | null | null | null | # Export Nexus device show interface brief command output to
# an Excel file
import json
import xlsxwriter
from netmiko import ConnectHandler
# Devices to SSH into
devices = [
{
"device_type": "cisco_nxos",
"ip": "sbx-nxos-mgmt.cisco.com",
"username": "admin",
"password": "Admin_1... | 34.033898 | 93 | 0.528884 | import json
import xlsxwriter
from netmiko import ConnectHandler
devices = [
{
"device_type": "cisco_nxos",
"ip": "sbx-nxos-mgmt.cisco.com",
"username": "admin",
"password": "Admin_1234!",
"port": 8181,
"fast_cli": False,
"session_log": "nxos-exercise4.log"... | true | true |
f72afbb1ae862f6cc33248e2ecf5c95000d6017c | 7,390 | py | Python | server/opendp_apps/dataset/dataset_formatter.py | opendifferentialprivacy/opendp-ux | 2669602d0a65f6a83d9e9916cbf753c38fd64c94 | [
"MIT"
] | null | null | null | server/opendp_apps/dataset/dataset_formatter.py | opendifferentialprivacy/opendp-ux | 2669602d0a65f6a83d9e9916cbf753c38fd64c94 | [
"MIT"
] | 82 | 2020-08-06T17:11:12.000Z | 2021-02-07T21:01:05.000Z | server/opendp_apps/dataset/dataset_formatter.py | opendifferentialprivacy/opendp-ux | 2669602d0a65f6a83d9e9916cbf753c38fd64c94 | [
"MIT"
] | 2 | 2020-10-16T22:03:24.000Z | 2020-11-15T22:45:19.000Z | """
Format a DataSetInfo for use in a JSON Release
"""
import json
from opendp_apps.dataset.models import DataSetInfo
from opendp_apps.dataset import static_vals as dstatic
from opendp_apps.model_helpers.basic_err_check import BasicErrCheck
from opendp_apps.model_helpers.basic_response import ok_resp, err_resp, BasicRe... | 34.858491 | 102 | 0.604195 | import json
from opendp_apps.dataset.models import DataSetInfo
from opendp_apps.dataset import static_vals as dstatic
from opendp_apps.model_helpers.basic_err_check import BasicErrCheck
from opendp_apps.model_helpers.basic_response import ok_resp, err_resp, BasicResponse
class DataSetFormatter(BasicErrCheck):
... | true | true |
f72afc6fd07bcfad6b0ce2194a5a5dfd54a13f25 | 9,191 | py | Python | 04_test.py | 500kg/learn2branch | 693d6f68def3ce290a0f5f289820e708019c019a | [
"MIT"
] | 248 | 2019-01-10T21:58:46.000Z | 2022-03-30T07:55:34.000Z | 04_test.py | 500kg/learn2branch | 693d6f68def3ce290a0f5f289820e708019c019a | [
"MIT"
] | 17 | 2018-10-09T19:17:25.000Z | 2022-02-27T07:33:11.000Z | 04_test.py | 500kg/learn2branch | 693d6f68def3ce290a0f5f289820e708019c019a | [
"MIT"
] | 66 | 2019-06-08T12:18:43.000Z | 2022-03-29T07:44:18.000Z | import os
import sys
import importlib
import argparse
import csv
import numpy as np
import time
import pickle
import pathlib
import gzip
import tensorflow as tf
import tensorflow.contrib.eager as tfe
import svmrank
import utilities
from utilities_tf import load_batch_gcnn
def load_batch_flat(sample_files, feats_t... | 37.060484 | 158 | 0.586878 | import os
import sys
import importlib
import argparse
import csv
import numpy as np
import time
import pickle
import pathlib
import gzip
import tensorflow as tf
import tensorflow.contrib.eager as tfe
import svmrank
import utilities
from utilities_tf import load_batch_gcnn
def load_batch_flat(sample_files, feats_t... | true | true |
f72afdb37d0bc3631c2708300be0110723f46ee0 | 4,090 | py | Python | src/python/pants/ivy/ivy_subsystem.py | SergeKireev/pants | cd92c65aeb3dfdcee3e0946f2b68a301ef2f4541 | [
"Apache-2.0"
] | 1 | 2020-08-26T03:30:31.000Z | 2020-08-26T03:30:31.000Z | src/python/pants/ivy/ivy_subsystem.py | SergeKireev/pants | cd92c65aeb3dfdcee3e0946f2b68a301ef2f4541 | [
"Apache-2.0"
] | 1 | 2021-09-02T21:06:31.000Z | 2021-09-02T21:06:31.000Z | src/python/pants/ivy/ivy_subsystem.py | SergeKireev/pants | cd92c65aeb3dfdcee3e0946f2b68a301ef2f4541 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import urllib
from pants.java.distribution.distribution import DistributionLocator
from pants.subsystem.subsystem import Subsystem
class IvySubsystem(Subsystem):
"""Common c... | 37.181818 | 97 | 0.674817 |
import os
import urllib
from pants.java.distribution.distribution import DistributionLocator
from pants.subsystem.subsystem import Subsystem
class IvySubsystem(Subsystem):
options_scope = 'ivy'
_DEFAULT_VERSION = '2.4.0'
_DEFAULT_URL = ('https://repo1.maven.org/maven2/'
'org/apache/ivy/ivy/... | true | true |
f72afdfc03221196ea9ceaf1098c9e1569cc1366 | 808 | py | Python | sampling/text.py | YoannDupont/corpus-sampling | 20fd993bc967fd499e88444d882472ba7598c197 | [
"MIT"
] | null | null | null | sampling/text.py | YoannDupont/corpus-sampling | 20fd993bc967fd499e88444d882472ba7598c197 | [
"MIT"
] | null | null | null | sampling/text.py | YoannDupont/corpus-sampling | 20fd993bc967fd499e88444d882472ba7598c197 | [
"MIT"
] | null | null | null | from pathlib import Path
import nltk
from nltk.tokenize import sent_tokenize
tokenizer = nltk.RegexpTokenizer(r"([A-Z][A-Z0-9.]+|[0-9]+[,.][0-9]+|[cdjlmnst]'|qu'|[\w'-]+|\S)")
class Sentence:
def __init__(self, text, nth):
self.text = text
self.nth = nth
def __len__(self):
return le... | 22.444444 | 98 | 0.62005 | from pathlib import Path
import nltk
from nltk.tokenize import sent_tokenize
tokenizer = nltk.RegexpTokenizer(r"([A-Z][A-Z0-9.]+|[0-9]+[,.][0-9]+|[cdjlmnst]'|qu'|[\w'-]+|\S)")
class Sentence:
def __init__(self, text, nth):
self.text = text
self.nth = nth
def __len__(self):
return le... | true | true |
f72aff11df732c260aca806b126e282388a93204 | 4,897 | py | Python | seahub/api2/authentication.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | 2 | 2017-06-21T09:46:55.000Z | 2018-05-30T10:07:32.000Z | seahub/api2/authentication.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | null | null | null | seahub/api2/authentication.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | 1 | 2020-10-01T04:11:41.000Z | 2020-10-01T04:11:41.000Z | import datetime
import logging
from rest_framework import status
from rest_framework.authentication import BaseAuthentication
from rest_framework.exceptions import APIException
import seaserv
from seahub.base.accounts import User
from seahub.constants import GUEST_USER
from seahub.api2.models import Token, TokenV2
fro... | 33.772414 | 95 | 0.647131 | import datetime
import logging
from rest_framework import status
from rest_framework.authentication import BaseAuthentication
from rest_framework.exceptions import APIException
import seaserv
from seahub.base.accounts import User
from seahub.constants import GUEST_USER
from seahub.api2.models import Token, TokenV2
fro... | true | true |
f72affbaf63edad2e1efdfe81604b7c4734c0339 | 405 | py | Python | setup.py | mstroud/python-matrix-gfyrslf | 0375bfb12d1cd50611f01101917d2cd2123543e4 | [
"MIT"
] | null | null | null | setup.py | mstroud/python-matrix-gfyrslf | 0375bfb12d1cd50611f01101917d2cd2123543e4 | [
"MIT"
] | null | null | null | setup.py | mstroud/python-matrix-gfyrslf | 0375bfb12d1cd50611f01101917d2cd2123543e4 | [
"MIT"
] | null | null | null | from distutils.core import setup
DESC='A simple, extensible chatbot for Matrix'
setup(
name='python-matrix-gfyrslf',
version='0.1',
author='Matt Stroud',
author_email='see github',
url='https://github.com/mstroud/python-matrix-gfyrslf',
packages=['python-matrix-gfyrslf'],
install_requires=... | 23.823529 | 59 | 0.688889 | from distutils.core import setup
DESC='A simple, extensible chatbot for Matrix'
setup(
name='python-matrix-gfyrslf',
version='0.1',
author='Matt Stroud',
author_email='see github',
url='https://github.com/mstroud/python-matrix-gfyrslf',
packages=['python-matrix-gfyrslf'],
install_requires=... | true | true |
f72b00a5286e87e05ac8c588aa0072278e0c0565 | 30 | py | Python | bot/__init__.py | Sc2-AI-Cup/example-bot-workerrush | 6a4ddcc4c22018bcd64d07ba405b7ef13ed634f2 | [
"MIT"
] | null | null | null | bot/__init__.py | Sc2-AI-Cup/example-bot-workerrush | 6a4ddcc4c22018bcd64d07ba405b7ef13ed634f2 | [
"MIT"
] | null | null | null | bot/__init__.py | Sc2-AI-Cup/example-bot-workerrush | 6a4ddcc4c22018bcd64d07ba405b7ef13ed634f2 | [
"MIT"
] | null | null | null | from .bot import WorkerRushBot | 30 | 30 | 0.866667 | from .bot import WorkerRushBot | true | true |
f72b00c52fc98e9202a373c7817029e4bb84f7b4 | 8,185 | py | Python | controllers.py | Yoshiyuki-Su/FastAPITodo | d9efcc2793eb5191f70923eb669eb9a1a3fcc427 | [
"MIT"
] | null | null | null | controllers.py | Yoshiyuki-Su/FastAPITodo | d9efcc2793eb5191f70923eb669eb9a1a3fcc427 | [
"MIT"
] | 6 | 2020-11-23T14:38:55.000Z | 2021-01-10T16:55:57.000Z | controllers.py | Yoshiyuki-Su/FastAPITodo | d9efcc2793eb5191f70923eb669eb9a1a3fcc427 | [
"MIT"
] | null | null | null | from fastapi import FastAPI, Depends, Form
from fastapi.security import HTTPBasic, HTTPBasicCredentials
from starlette.templating import Jinja2Templates
from starlette.requests import Request
from starlette.responses import RedirectResponse
from datetime import datetime, timedelta
import db
import hashlib
from mycalen... | 32.871486 | 94 | 0.579475 | from fastapi import FastAPI, Depends, Form
from fastapi.security import HTTPBasic, HTTPBasicCredentials
from starlette.templating import Jinja2Templates
from starlette.requests import Request
from starlette.responses import RedirectResponse
from datetime import datetime, timedelta
import db
import hashlib
from mycalen... | true | true |
f72b01644b9c24e4ff1dde34645ffd6b1aec9355 | 2,765 | py | Python | Contrib/LEF/ClusterFps.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 1,609 | 2015-01-05T02:41:13.000Z | 2022-03-30T21:57:24.000Z | Contrib/LEF/ClusterFps.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 3,412 | 2015-01-06T12:13:33.000Z | 2022-03-31T17:25:41.000Z | Contrib/LEF/ClusterFps.py | kazuyaujihara/rdkit | 06027dcd05674787b61f27ba46ec0d42a6037540 | [
"BSD-3-Clause"
] | 811 | 2015-01-11T03:33:48.000Z | 2022-03-28T11:57:49.000Z | #
# Copyright (c) 2009, Novartis Institutes for BioMedical Research Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyri... | 37.364865 | 86 | 0.707052 |
from rdkit.ML.Cluster import Butina
from rdkit import DataStructs
import sys, pickle
sims = [.9, .8, .7, .6]
smis = []
uniq = []
uFps = []
for fileN in sys.argv[1:]:
inF = file(sys.argv[1], 'r')
cols = pickle.load(inF)
fps = pickle.load(inF)
for row in fps:
nm, smi, fp = row[:3]
if smi not in smis:
... | true | true |
f72b01a7f0fb8665343e290a8c45dfabc5c03f99 | 801 | py | Python | predictability_utils/utils/helpers.py | marpyr/forecast_predictability | 2285b37e20095ae6f67533595bcb0580882924a2 | [
"MIT"
] | 2 | 2020-10-23T08:58:18.000Z | 2021-05-03T17:30:03.000Z | predictability_utils/utils/helpers.py | marpyr/forecast_predictability | 2285b37e20095ae6f67533595bcb0580882924a2 | [
"MIT"
] | null | null | null | predictability_utils/utils/helpers.py | marpyr/forecast_predictability | 2285b37e20095ae6f67533595bcb0580882924a2 | [
"MIT"
] | 1 | 2020-10-23T09:07:19.000Z | 2020-10-23T09:07:19.000Z | import numpy as np
def compute_anomaly_corrs(out_true, out_pred):
anomaly_corrs = np.zeros(out_pred.shape[1])
for i in range(anomaly_corrs.size):
anomaly_corrs[i] = np.corrcoef(out_pred[:,i], out_true[:,i])[0,1]
return anomaly_corrs
def split_train_data(train_months, test_months, tra... | 36.409091 | 80 | 0.740325 | import numpy as np
def compute_anomaly_corrs(out_true, out_pred):
anomaly_corrs = np.zeros(out_pred.shape[1])
for i in range(anomaly_corrs.size):
anomaly_corrs[i] = np.corrcoef(out_pred[:,i], out_true[:,i])[0,1]
return anomaly_corrs
def split_train_data(train_months, test_months, tra... | true | true |
f72b01c050db440e10771a348c74c4d89b91660f | 19,971 | py | Python | dfvfs/lib/gzipfile.py | dfjxs/dfvfs | a4154b07bb08c3c86afa2847f3224189dd80c138 | [
"Apache-2.0"
] | 176 | 2015-01-02T13:55:39.000Z | 2022-03-12T11:44:37.000Z | dfvfs/lib/gzipfile.py | dfjxs/dfvfs | a4154b07bb08c3c86afa2847f3224189dd80c138 | [
"Apache-2.0"
] | 495 | 2015-01-13T06:47:06.000Z | 2022-03-12T11:07:03.000Z | dfvfs/lib/gzipfile.py | dfjxs/dfvfs | a4154b07bb08c3c86afa2847f3224189dd80c138 | [
"Apache-2.0"
] | 62 | 2015-02-23T08:19:38.000Z | 2022-03-18T06:01:22.000Z | # -*- coding: utf-8 -*-
"""Gzip compressed stream file."""
# Note: do not rename file to gzip.py this can cause the exception:
# AttributeError: 'module' object has no attribute 'GzipFile'
# when using pip.
import collections
import os
from dtfabric.runtime import fabric as dtfabric_fabric
from dfvfs.compression im... | 33.452261 | 80 | 0.714286 |
import collections
import os
from dtfabric.runtime import fabric as dtfabric_fabric
from dfvfs.compression import zlib_decompressor
from dfvfs.lib import data_format
from dfvfs.lib import errors
class _GzipDecompressorState(object):
_MAXIMUM_READ_SIZE = 16 * 1024 * 1024
def __init__(self, stream_start):
... | true | true |
f72b027333bbe2d8bc09150e018d4e2a3f9db7df | 11,472 | py | Python | vspk/v4_0/nustaticroute.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | null | null | null | vspk/v4_0/nustaticroute.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | null | null | null | vspk/v4_0/nustaticroute.py | mohaimenhasan/vspk-python | 4c7b297427048340b250cc3c74d9214dc0d4bde1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyrigh... | 29.720207 | 369 | 0.602772 |
from .fetchers import NUMetadatasFetcher
from .fetchers import NUGlobalMetadatasFetcher
from .fetchers import NUEventLogsFetcher
from bambou import NURESTObject
class NUStaticRoute(NURESTObject):
__rest_name__ = "staticroute"
__resource_name__ = "staticroutes"
CONST_ENTITY_SCOPE_G... | true | true |
f72b045654dc44f3155f6d877133a3202b759449 | 5,054 | py | Python | python-lib/dku_error_analysis_mpp/dku_error_visualizer.py | dataiku/dss-plugin-model-error-analysis | 4c0f42a5c0aa1710005db3d81ca9bd9d7f829e6b | [
"Apache-2.0"
] | null | null | null | python-lib/dku_error_analysis_mpp/dku_error_visualizer.py | dataiku/dss-plugin-model-error-analysis | 4c0f42a5c0aa1710005db3d81ca9bd9d7f829e6b | [
"Apache-2.0"
] | 2 | 2021-09-29T15:08:25.000Z | 2022-01-13T11:20:58.000Z | python-lib/dku_error_analysis_mpp/dku_error_visualizer.py | dataiku/dss-plugin-model-error-analysis | 4c0f42a5c0aa1710005db3d81ca9bd9d7f829e6b | [
"Apache-2.0"
] | 1 | 2021-09-10T12:25:08.000Z | 2021-09-10T12:25:08.000Z | # -*- coding: utf-8 -*-
import numpy as np
from graphviz import Source
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from dku_error_analysis_mpp.dku_error_analyzer import DkuErrorAnalyzer
from mealy import _BaseErrorVisualizer, ErrorAnalyzerConstants
from dku_error_analysis_utils import safe_s... | 49.54902 | 149 | 0.609616 | import numpy as np
from graphviz import Source
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from dku_error_analysis_mpp.dku_error_analyzer import DkuErrorAnalyzer
from mealy import _BaseErrorVisualizer, ErrorAnalyzerConstants
from dku_error_analysis_utils import safe_str, format_float
import... | true | true |
f72b04ab534d3991395505fbd9524526beed8f88 | 5,288 | py | Python | seahub/api2/endpoints/draft_reviewer.py | odontomachus/seahub | 5b6f2153921da21a473d9ff20ce443d40efc93ab | [
"Apache-2.0"
] | null | null | null | seahub/api2/endpoints/draft_reviewer.py | odontomachus/seahub | 5b6f2153921da21a473d9ff20ce443d40efc93ab | [
"Apache-2.0"
] | 6 | 2019-12-13T09:55:45.000Z | 2022-03-11T23:47:29.000Z | seahub/api2/endpoints/draft_reviewer.py | odontomachus/seahub | 5b6f2153921da21a473d9ff20ce443d40efc93ab | [
"Apache-2.0"
] | 1 | 2019-05-16T06:58:16.000Z | 2019-05-16T06:58:16.000Z | # Copyright (c) 2012-2016 Seafile Ltd.
import posixpath
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from django.utils.trans... | 34.562092 | 106 | 0.587368 | import posixpath
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from django.utils.translation import ugettext as _
from sease... | true | true |
f72b04c22d26af35d88e3f843c7d2b7c9e606c26 | 120 | py | Python | module_2/lab2_1_1_7.py | dzooli/pcep_prepare | ddf34991a2d6ef2cfe3bda706ec333e9caa2aea5 | [
"MIT"
] | null | null | null | module_2/lab2_1_1_7.py | dzooli/pcep_prepare | ddf34991a2d6ef2cfe3bda706ec333e9caa2aea5 | [
"MIT"
] | null | null | null | module_2/lab2_1_1_7.py | dzooli/pcep_prepare | ddf34991a2d6ef2cfe3bda706ec333e9caa2aea5 | [
"MIT"
] | null | null | null | print("Hello, Python!")
print("Zoltan")
#print(Zoltan)
#print "Zoltan"
print('Zoltan')
print('''
Alma
on the
tree
'''
)
| 10 | 23 | 0.65 | print("Hello, Python!")
print("Zoltan")
print('Zoltan')
print('''
Alma
on the
tree
'''
)
| true | true |
f72b058123386b2f12effdfae7010abf516ca956 | 13,314 | py | Python | Lib/json/__init__.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | null | null | null | Lib/json/__init__.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | null | null | null | Lib/json/__init__.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | null | null | null | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`json` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is derived from a
version of the externally m... | 39.981982 | 81 | 0.653372 | __version__ = '2.0.9'
__all__ = [
'dump', 'dumps', 'load', 'loads',
'JSONDecoder', 'JSONDecodeError', 'JSONEncoder',
]
__author__ = 'Bob Ippolito <bob@redivi.com>'
from .decoder import JSONDecoder, JSONDecodeError
from .encoder import JSONEncoder
_default_encoder = JSONEncoder(
skipkeys=False,
ensure... | true | true |
f72b05a1e16676d1178d4682bdc7c44175562994 | 3,192 | py | Python | scripts/loadelastic-aurora.py | dbmi-pitt/aurora-meta | a0d3d3963fce2639081cb55715b5357cd0e21902 | [
"Apache-2.0"
] | null | null | null | scripts/loadelastic-aurora.py | dbmi-pitt/aurora-meta | a0d3d3963fce2639081cb55715b5357cd0e21902 | [
"Apache-2.0"
] | null | null | null | scripts/loadelastic-aurora.py | dbmi-pitt/aurora-meta | a0d3d3963fce2639081cb55715b5357cd0e21902 | [
"Apache-2.0"
] | null | null | null | import requests, json, os
import argparse
import pandas as pd
import ijson
import time
# Elasticsearch python libs
from elasticsearch import Elasticsearch
from elasticsearch import helpers
directory = ""
indexName = "aurora-meta2"
typeName = "patient"
THRESHOLD = 10000 # this regulates how much data gets loaded the... | 25.95122 | 109 | 0.628446 | import requests, json, os
import argparse
import pandas as pd
import ijson
import time
from elasticsearch import Elasticsearch
from elasticsearch import helpers
directory = ""
indexName = "aurora-meta2"
typeName = "patient"
THRESHOLD = 10000 PK = "ID"
json_root = "item"
errors = []
def loadit():
es = Elasticsearc... | true | true |
f72b05a397836379cf15a5545dc470a6f2762a91 | 5,781 | py | Python | smoke/data/build.py | SmallMunich/Smoke | 591a03bdb5cad962999914c9a97c7a8bed9e529b | [
"MIT"
] | 2 | 2022-03-08T02:54:57.000Z | 2022-03-10T09:09:40.000Z | smoke/data/build.py | SmallMunich/Smoke | 591a03bdb5cad962999914c9a97c7a8bed9e529b | [
"MIT"
] | null | null | null | smoke/data/build.py | SmallMunich/Smoke | 591a03bdb5cad962999914c9a97c7a8bed9e529b | [
"MIT"
] | null | null | null | import logging
import copy
import bisect
import numpy as np
import torch.utils.data
from smoke.utils.comm import get_world_size
from smoke.utils.imports import import_file
from smoke.utils.envs import seed_all_rng
from . import datasets as D
from . import samplers
from .transforms import build_transforms
from .colla... | 34.825301 | 145 | 0.669088 | import logging
import copy
import bisect
import numpy as np
import torch.utils.data
from smoke.utils.comm import get_world_size
from smoke.utils.imports import import_file
from smoke.utils.envs import seed_all_rng
from . import datasets as D
from . import samplers
from .transforms import build_transforms
from .colla... | true | true |
f72b0684f170d3fddc3fc47d05fff76101d188b3 | 1,072 | py | Python | i3wsgroups/cli.py | damani42/i3-workspace-groups | 13fe8e22e829166eb22df031b4c39f3501dfb362 | [
"MIT"
] | null | null | null | i3wsgroups/cli.py | damani42/i3-workspace-groups | 13fe8e22e829166eb22df031b4c39f3501dfb362 | [
"MIT"
] | null | null | null | i3wsgroups/cli.py | damani42/i3-workspace-groups | 13fe8e22e829166eb22df031b4c39f3501dfb362 | [
"MIT"
] | null | null | null | import argparse
def add_common_args(parser: argparse.ArgumentParser):
parser.add_argument(
'--dry-run',
action='store_true',
default=False,
help='If true, will not actually do any changes to i3 workspaces.')
parser.add_argument(
'--log-level',
choices=('debug', ... | 34.580645 | 78 | 0.636194 | import argparse
def add_common_args(parser: argparse.ArgumentParser):
parser.add_argument(
'--dry-run',
action='store_true',
default=False,
help='If true, will not actually do any changes to i3 workspaces.')
parser.add_argument(
'--log-level',
choices=('debug', ... | true | true |
f72b073f2c249ce06aea52ce2b03bad057fb64ac | 10,626 | py | Python | src/neqsim/process/processTools.py | kwafafoa/neqsimpython | 2a540297552b39dac2666bbfb7c76eda0f5779db | [
"Apache-2.0"
] | null | null | null | src/neqsim/process/processTools.py | kwafafoa/neqsimpython | 2a540297552b39dac2666bbfb7c76eda0f5779db | [
"Apache-2.0"
] | null | null | null | src/neqsim/process/processTools.py | kwafafoa/neqsimpython | 2a540297552b39dac2666bbfb7c76eda0f5779db | [
"Apache-2.0"
] | null | null | null | import jpype
import jpype.imports
from jpype.types import *
from neqsim.neqsimpython import neqsim
processoperations = neqsim.processSimulation.processSystem.ProcessSystem()
def stream(thermoSystem, name="stream ?", t=0, p=0):
if t != 0:
thermoSystem.setTemperature(t)
if p != 0:
thermo... | 36.768166 | 159 | 0.769245 | import jpype
import jpype.imports
from jpype.types import *
from neqsim.neqsimpython import neqsim
processoperations = neqsim.processSimulation.processSystem.ProcessSystem()
def stream(thermoSystem, name="stream ?", t=0, p=0):
if t != 0:
thermoSystem.setTemperature(t)
if p != 0:
thermo... | true | true |
f72b0759efafb83d0661f521221014ba2f8d3aab | 7,021 | py | Python | tests/graph/test_floyd_warshall.py | aalekhpatel07/retworkx | ae93fcab17d55bc259476c65a677221b4177870a | [
"Apache-2.0"
] | 1 | 2021-11-29T23:15:07.000Z | 2021-11-29T23:15:07.000Z | tests/graph/test_floyd_warshall.py | aalekhpatel07/retworkx | ae93fcab17d55bc259476c65a677221b4177870a | [
"Apache-2.0"
] | 40 | 2020-08-31T06:09:06.000Z | 2022-03-18T19:02:34.000Z | tests/graph/test_floyd_warshall.py | aalekhpatel07/retworkx | ae93fcab17d55bc259476c65a677221b4177870a | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 32.808411 | 79 | 0.565874 |
import unittest
import numpy
import retworkx
class TestFloydWarshall(unittest.TestCase):
parallel_threshold = 300
def test_vs_dijkstra_all_pairs(self):
graph = retworkx.PyGraph()
a = graph.add_node("A")
b = graph.add_node("B")
c = graph.add_node("C")
d = graph.add_n... | true | true |
f72b08276373a7b8064dc7eb363bb32779d3d0ce | 9,830 | py | Python | anima/ui/widgets/task_dashboard.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 101 | 2015-02-08T22:20:11.000Z | 2022-03-21T18:56:42.000Z | anima/ui/widgets/task_dashboard.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 23 | 2016-11-30T08:33:21.000Z | 2021-01-26T12:11:12.000Z | anima/ui/widgets/task_dashboard.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 27 | 2015-01-03T06:49:45.000Z | 2021-12-28T03:30:54.000Z | # -*- coding: utf-8 -*-
from anima.ui.lib import QtCore, QtWidgets
class TaskDashboardWidget(QtWidgets.QWidget):
"""A widget that displays task related information
"""
def __init__(self, task=None, parent=None, **kwargs):
self._task = None
self.parent = parent
super(TaskDashboa... | 35.487365 | 87 | 0.649135 |
from anima.ui.lib import QtCore, QtWidgets
class TaskDashboardWidget(QtWidgets.QWidget):
def __init__(self, task=None, parent=None, **kwargs):
self._task = None
self.parent = parent
super(TaskDashboardWidget, self).__init__(parent=parent)
self.vertical_layout = None
... | true | true |
f72b08b59e5cb86bba78fc94a90a6d1fa03c18e3 | 6,363 | py | Python | lsdr/envs/analysis.py | melfm/lsdr | 36b0a85e970fdcaae828eeff6c147432aa767c93 | [
"MIT"
] | 3 | 2019-09-20T19:10:50.000Z | 2021-12-30T02:55:21.000Z | lsdr/envs/analysis.py | melfm/lsdr | 36b0a85e970fdcaae828eeff6c147432aa767c93 | [
"MIT"
] | null | null | null | lsdr/envs/analysis.py | melfm/lsdr | 36b0a85e970fdcaae828eeff6c147432aa767c93 | [
"MIT"
] | 1 | 2020-08-01T21:28:12.000Z | 2020-08-01T21:28:12.000Z | import numpy as np
import torch
import matplotlib.pyplot as plt
import os
import math
import scipy.stats as stats
import lsdr.envs.environment_sampler as env_sampler
from enum import IntEnum
############################
# Optimization Loss Opt
############################
class Objectives(IntEnum):
REWARDS = 1
... | 28.28 | 78 | 0.573157 | import numpy as np
import torch
import matplotlib.pyplot as plt
import os
import math
import scipy.stats as stats
import lsdr.envs.environment_sampler as env_sampler
from enum import IntEnum
class Objectives(IntEnum):
REWARDS = 1
KL_OPT = 2
REW_AND_KL = 3
def reward_function(x):
return np.exp(-(x-20... | true | true |
f72b09030b2c9ba7bc22260ba632e1a45e870da9 | 1,020 | py | Python | examples/pitz_daily/pitz_daily_runner.py | ImperialCollegeLondon/al_cfd_benchmark | 03b51d7e7d4def804e2ac18084deee8401636851 | [
"MIT"
] | 6 | 2020-09-27T00:14:48.000Z | 2021-11-23T03:35:09.000Z | examples/pitz_daily/pitz_daily_runner.py | ImperialCollegeLondon/al_cfd_benchmark | 03b51d7e7d4def804e2ac18084deee8401636851 | [
"MIT"
] | null | null | null | examples/pitz_daily/pitz_daily_runner.py | ImperialCollegeLondon/al_cfd_benchmark | 03b51d7e7d4def804e2ac18084deee8401636851 | [
"MIT"
] | 2 | 2020-09-27T17:40:33.000Z | 2021-12-13T02:31:49.000Z | # -*- coding: utf-8 -*-
"""Pitz Daily
This case uses the pitzDaily example from the OpenFOAM tutorials
and varies two parameters: Reynolds number and height of the inlet.
It returns the pressure difference between inlet and outlet.
"""
import numpy as np
from active_learning_cfd.cfd_case import CFDCase
import os
... | 28.333333 | 77 | 0.683333 |
import numpy as np
from active_learning_cfd.cfd_case import CFDCase
import os
class PitzDaily(CFDCase):
mesher = "blockMesh"
solver = "simpleFoam"
template = "pitzDaily"
parameter_names = ("reynolds", "entryHeight")
output_list = (("deltaP", "subtract\(p\) = (.+)"),)
def __call__(self, para... | true | true |
f72b091c4068f3540061214d903965fad918e1a4 | 5,557 | py | Python | cogdl/oag/dual_position_bert_model.py | li-ziang/cogdl | 60022d3334e3abae2d2a505e6e049a26acf10f39 | [
"MIT"
] | 6 | 2020-07-09T02:48:41.000Z | 2021-06-16T09:04:14.000Z | cogdl/oag/dual_position_bert_model.py | li-ziang/cogdl | 60022d3334e3abae2d2a505e6e049a26acf10f39 | [
"MIT"
] | null | null | null | cogdl/oag/dual_position_bert_model.py | li-ziang/cogdl | 60022d3334e3abae2d2a505e6e049a26acf10f39 | [
"MIT"
] | 1 | 2020-05-19T11:45:45.000Z | 2020-05-19T11:45:45.000Z | import torch
from torch import nn
from torch.nn import CrossEntropyLoss
import logging
from .bert_model import BertPreTrainedModel, BertPreTrainingHeads, BertModel, BertEncoder, BertPooler, BertLayerNorm
logger = logging.getLogger(__name__)
class DualPositionBertEmbeddings(nn.Module):
"""Construct the embedding... | 41.781955 | 119 | 0.703617 | import torch
from torch import nn
from torch.nn import CrossEntropyLoss
import logging
from .bert_model import BertPreTrainedModel, BertPreTrainingHeads, BertModel, BertEncoder, BertPooler, BertLayerNorm
logger = logging.getLogger(__name__)
class DualPositionBertEmbeddings(nn.Module):
def __init__(self, config... | true | true |
f72b094590d5184ffbaf3cd4a122b4c8a53db388 | 7,097 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2020_11_01_preview/_container_registry_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2020_11_01_preview/_container_registry_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2020_11_01_preview/_container_registry_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 53.360902 | 286 | 0.748908 |
from copy import deepcopy
from typing import Any, Optional, TYPE_CHECKING
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer
from . import models
from ._configuration import ContainerRegistryManagementClientConfiguration
fro... | true | true |
f72b097de1b2982d94f31803515377aa94536b9a | 1,869 | py | Python | authentik/stages/deny/tests.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 15 | 2020-01-05T09:09:57.000Z | 2020-11-28T05:27:39.000Z | authentik/stages/deny/tests.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 302 | 2020-01-21T08:03:59.000Z | 2020-12-04T05:04:57.000Z | authentik/stages/deny/tests.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 3 | 2020-03-04T08:21:59.000Z | 2020-08-01T20:37:18.000Z | """deny tests"""
from django.urls import reverse
from authentik.core.tests.utils import create_test_admin_user, create_test_flow
from authentik.flows.markers import StageMarker
from authentik.flows.models import FlowDesignation, FlowStageBinding
from authentik.flows.planner import FlowPlan
from authentik.flows.tests i... | 38.9375 | 99 | 0.70626 | from django.urls import reverse
from authentik.core.tests.utils import create_test_admin_user, create_test_flow
from authentik.flows.markers import StageMarker
from authentik.flows.models import FlowDesignation, FlowStageBinding
from authentik.flows.planner import FlowPlan
from authentik.flows.tests import FlowTestCas... | true | true |
f72b09d34e7b78c00c0b504b76cded6aa3b45a39 | 1,425 | py | Python | models/vasilyev2020/src/score.py | leoribeiro/repro | 7dc2ad611925542b4deb62fd1e30761ba56a7f60 | [
"Apache-2.0"
] | 15 | 2021-07-28T19:52:03.000Z | 2022-03-28T15:55:17.000Z | models/vasilyev2020/src/score.py | leoribeiro/repro | 7dc2ad611925542b4deb62fd1e30761ba56a7f60 | [
"Apache-2.0"
] | 3 | 2021-11-19T17:09:34.000Z | 2022-02-14T19:40:48.000Z | models/vasilyev2020/src/score.py | leoribeiro/repro | 7dc2ad611925542b4deb62fd1e30761ba56a7f60 | [
"Apache-2.0"
] | null | null | null | import argparse
import json
import os
from blanc import BlancHelp, BlancTune
def main(args):
kwargs = json.loads(args.kwargs)
device = "cpu" if args.device == -1 else "cuda"
if args.type == "tune":
blanc = BlancTune(device=device, random_seed=args.random_seed, **kwargs)
elif args.type == "hel... | 31.666667 | 80 | 0.655439 | import argparse
import json
import os
from blanc import BlancHelp, BlancTune
def main(args):
kwargs = json.loads(args.kwargs)
device = "cpu" if args.device == -1 else "cuda"
if args.type == "tune":
blanc = BlancTune(device=device, random_seed=args.random_seed, **kwargs)
elif args.type == "hel... | true | true |
f72b0a2e2db8a201933a779f2d9eaf3fc70eda33 | 9,937 | py | Python | python/tvm/tensor_graph/testing/relay_examples/lenet.py | QinHan-Erin/AMOS | 634bf48edf4015e4a69a8c32d49b96bce2b5f16f | [
"Apache-2.0"
] | 22 | 2022-03-18T07:29:31.000Z | 2022-03-23T14:54:32.000Z | python/tvm/tensor_graph/testing/relay_examples/lenet.py | QinHan-Erin/AMOS | 634bf48edf4015e4a69a8c32d49b96bce2b5f16f | [
"Apache-2.0"
] | null | null | null | python/tvm/tensor_graph/testing/relay_examples/lenet.py | QinHan-Erin/AMOS | 634bf48edf4015e4a69a8c32d49b96bce2b5f16f | [
"Apache-2.0"
] | 2 | 2022-03-18T08:26:34.000Z | 2022-03-20T06:02:48.000Z | import tvm
import numpy as np
from tvm import relay
from tvm.relay.testing import run_infer_type, gradient
def get_lenet(batch_size,
num_classes=10,
image_shape=(1, 28, 28),
dtype="float32"):
"""Get lenet funciton
Parameters
----------
batch_size : int
The b... | 36.399267 | 138 | 0.600986 | import tvm
import numpy as np
from tvm import relay
from tvm.relay.testing import run_infer_type, gradient
def get_lenet(batch_size,
num_classes=10,
image_shape=(1, 28, 28),
dtype="float32"):
data_shape = (batch_size,) + image_shape
data = relay.TensorType(data_shape, dtype=... | true | true |
f72b0a4f41647e949ba4e6202d2c7f3980d53dab | 575 | py | Python | M5_assgmnt.py | AVNEETK99/FANTASY-CRICKET-LEAGUE | 17fc188e48a51c6f3937a9965f1edcead2a8d0b8 | [
"CC0-1.0"
] | 23 | 2018-07-18T10:47:12.000Z | 2021-07-31T21:53:17.000Z | M5_assgmnt.py | RupinSamria/Summer-Training-Python-development | 4fa38344d6aa71581b004c16eddeec22f9f739f4 | [
"CC0-1.0"
] | 3 | 2018-11-18T07:11:05.000Z | 2020-04-30T20:16:51.000Z | M5_assgmnt.py | RupinSamria/Summer-Training-Python-development | 4fa38344d6aa71581b004c16eddeec22f9f739f4 | [
"CC0-1.0"
] | 53 | 2018-10-04T05:49:30.000Z | 2021-12-12T15:52:17.000Z | import sqlite3
mystore=sqlite3.connect('bookstores.db')
mycursor=mystore.cursor()
sql=''' create table book (id integer primary key not null,title text(20),
author text(20),price real);'''
mycursor.execute(sql)
sql='''insert into book
values(1,'think java','rhooney',550.0);'''
mycursor.execute(sql)
mystore.c... | 21.296296 | 75 | 0.683478 | import sqlite3
mystore=sqlite3.connect('bookstores.db')
mycursor=mystore.cursor()
sql=''' create table book (id integer primary key not null,title text(20),
author text(20),price real);'''
mycursor.execute(sql)
sql='''insert into book
values(1,'think java','rhooney',550.0);'''
mycursor.execute(sql)
mystore.c... | true | true |
f72b0a5531db17b2a97a3179af5c86bd986dd358 | 12,137 | py | Python | test/data_join/test_data_block_dumper.py | chen1i/fedlearner | 981514dadbd0aa49ae87d185dd247d310e35605c | [
"Apache-2.0"
] | null | null | null | test/data_join/test_data_block_dumper.py | chen1i/fedlearner | 981514dadbd0aa49ae87d185dd247d310e35605c | [
"Apache-2.0"
] | null | null | null | test/data_join/test_data_block_dumper.py | chen1i/fedlearner | 981514dadbd0aa49ae87d185dd247d310e35605c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The FedLearner Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 49.538776 | 113 | 0.616215 |
import unittest
import os
import tensorflow.compat.v1 as tf
tf.enable_eager_execution()
from google.protobuf import text_format, timestamp_pb2
import tensorflow_io
from tensorflow.compat.v1 import gfile
from fedlearner.common import db_client
from fedlearner.common import common_pb2 as common_pb
from fedlearner.com... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.