hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c17441bfb727979816e5b18097bb9aa4765651e | 1,213 | py | Python | api/models/ec/tag.py | LuchaComics/comicscantina-django | 78e630000fb1e1f6299f80655c8f57a496236ab1 | [
"BSD-2-Clause"
] | null | null | null | api/models/ec/tag.py | LuchaComics/comicscantina-django | 78e630000fb1e1f6299f80655c8f57a496236ab1 | [
"BSD-2-Clause"
] | 5 | 2021-03-19T02:58:32.000Z | 2022-03-11T23:57:30.000Z | api/models/ec/tag.py | lendierickx/comics-django | 3f5c6e85c89ff157dbf67179ea3b9007d7de446c | [
"BSD-2-Clause"
] | null | null | null | from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from ecantina_project import constants
from api.models.ec.organization import Organization
from django.core.cache import caches
class Tag(models.Model):
class Meta:
app_label = 'api'
ordering = ('n... | 31.921053 | 79 | 0.6554 | from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from ecantina_project import constants
from api.models.ec.organization import Organization
from django.core.cache import caches
class Tag(models.Model):
class Meta:
app_label = 'api'
ordering = ('n... | true | true |
1c17444841537c3c02a5fed8a0ecfda98839ab73 | 396 | py | Python | examples/display_layouts_badge_test.py | FoamyGuy/Foamyguy_CircuitPython_DisplayIO_Inflater | c86d50c8727b4912d94c56226b58a35ccddb815d | [
"MIT",
"MIT-0",
"Unlicense"
] | 3 | 2020-06-29T19:00:23.000Z | 2021-05-06T21:56:07.000Z | examples/display_layouts_badge_test.py | FoamyGuy/circuitpython_display_layouts | d4380236d0613af8b77aaeeeb8d71dbd0a14dbd7 | [
"MIT"
] | null | null | null | examples/display_layouts_badge_test.py | FoamyGuy/circuitpython_display_layouts | d4380236d0613af8b77aaeeeb8d71dbd0a14dbd7 | [
"MIT"
] | null | null | null | import board
import displayio
from display_layouts.absolute_layout import AbsoluteLayout
f = open("layouts/badge_test.json", "r")
layout_str = f.read()
f.close()
main_layout = AbsoluteLayout(board.DISPLAY, layout_str)
board.DISPLAY.show(main_layout.view)
main_layout.sub_view_by_id("name_lbl").label.text = "Blinka"
ma... | 26.4 | 60 | 0.795455 | import board
import displayio
from display_layouts.absolute_layout import AbsoluteLayout
f = open("layouts/badge_test.json", "r")
layout_str = f.read()
f.close()
main_layout = AbsoluteLayout(board.DISPLAY, layout_str)
board.DISPLAY.show(main_layout.view)
main_layout.sub_view_by_id("name_lbl").label.text = "Blinka"
ma... | true | true |
1c174515b296026f30a9f69374ad03227c96f4f7 | 10,004 | py | Python | gui/qt/__init__.py | Excited4ButtStuff/Excited4ButtStuff | dea7833b523d99d1a1dcc8e6ea1c08292895553b | [
"MIT"
] | null | null | null | gui/qt/__init__.py | Excited4ButtStuff/Excited4ButtStuff | dea7833b523d99d1a1dcc8e6ea1c08292895553b | [
"MIT"
] | 1 | 2021-06-01T21:43:41.000Z | 2021-06-01T21:43:41.000Z | gui/qt/__init__.py | Excited4ButtStuff/Excited4ButtStuff | dea7833b523d99d1a1dcc8e6ea1c08292895553b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... | 36.779412 | 141 | 0.636545 |
import signal
import sys
try:
import PyQt5
except Exception:
sys.exit("Error: Could not import PyQt5 on Linux systems, you may try 'sudo apt-get install python3-pyqt5'")
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import PyQt5.QtCore as QtCore
from electrum_ltc.i18n i... | true | true |
1c17453b1d36bca0b8ef8a4caa7b03b4d0a1bee2 | 1,853 | py | Python | tests/unit/dataactvalidator/test_b5_object_class_program_activity_2.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | null | null | null | tests/unit/dataactvalidator/test_b5_object_class_program_activity_2.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | 3 | 2021-08-22T11:47:45.000Z | 2022-03-29T22:06:49.000Z | tests/unit/dataactvalidator/test_b5_object_class_program_activity_2.py | RonSherfey/data-act-broker-backend | d287abda2cac06dd479ecf0127e789cb8e59387d | [
"CC0-1.0"
] | null | null | null | from tests.unit.dataactcore.factories.staging import ObjectClassProgramActivityFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'b5_object_class_program_activity_2'
def test_column_headers(database):
expected_subset = {'row_number', 'gross_outlay_amount_by_pro_cpe', '... | 50.081081 | 116 | 0.724771 | from tests.unit.dataactcore.factories.staging import ObjectClassProgramActivityFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'b5_object_class_program_activity_2'
def test_column_headers(database):
expected_subset = {'row_number', 'gross_outlay_amount_by_pro_cpe', '... | true | true |
1c17464091b9a59e9b500e0226d6bb2fa583ea00 | 3,015 | py | Python | sdk/python/pulumi_gcp/organizations/iam_member.py | pulumi-bot/pulumi-gcp | 43ff11bf1c99b4e9e493f61d9755e359b686ae67 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/organizations/iam_member.py | pulumi-bot/pulumi-gcp | 43ff11bf1c99b4e9e493f61d9755e359b686ae67 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_gcp/organizations/iam_member.py | pulumi-bot/pulumi-gcp | 43ff11bf1c99b4e9e493f61d9755e359b686ae67 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
class IAMMember(pulumi.CustomResource):
"""
Allows creation and management of a single mem... | 38.164557 | 89 | 0.625539 |
import pulumi
import pulumi.runtime
class IAMMember(pulumi.CustomResource):
def __init__(__self__, __name__, __opts__=None, member=None, org_id=None, role=None):
if not __name__:
raise TypeError('Missing resource name argument (for URN creation)')
if not isinstance(__name__, basestring... | true | true |
1c174697cd0bee73aefc5607ba8b631bb04da28d | 2,252 | py | Python | google-cloud-sdk/lib/surface/runtime_config/configs/waiters/describe.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/runtime_config/configs/waiters/describe.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/runtime_config/configs/waiters/describe.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 29.631579 | 77 | 0.702043 |
from googlecloudsdk.api_lib.runtime_config import util
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.runtime_config import flags
class Describe(base.DescribeCommand):
detailed_help = {
'EXAMPLES': """\
To describe a waiter named "my-waiter" within a configuration named
... | true | true |
1c1746f2cfcc0bec6c8056648dbfa3bb64811092 | 2,513 | py | Python | examples/adspygoogle/dfp/v201211/update_teams.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201211/update_teams.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | examples/adspygoogle/dfp/v201211/update_teams.py | krux/adspygoogle | 6505a71122f45fe3e675f27f2c29f67a1768069b | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2020-04-02T19:00:31.000Z | 2020-08-06T03:28:38.000Z | #!/usr/bin/python
#
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 31.810127 | 80 | 0.717071 |
"""This example updates teams by adding an ad unit to the first 5.
To determine which teams exist, run get_all_teams.py. To determine which ad
units exist, run get_all_ad_units.py
Tags: TeamService.getTeamsByStatement, TeamService.updateTeams
"""
__author__ = 'api.shamjeff@gmail.com (Jeff Sham)'
import os
import s... | false | true |
1c17472608b7e1768b50744d37ef411a350d5642 | 1,955 | py | Python | get-captcha.py | MSadeghzadehG/uni_portal_scraper | b6be6fec505cce649be92331233f1e7032b98996 | [
"Apache-2.0"
] | 1 | 2021-06-27T07:20:38.000Z | 2021-06-27T07:20:38.000Z | get-captcha.py | mmkhmmkh/Uni_Portal_Scraper | fb88eb57c9137f4f42805b43bb553f21d2d8f89c | [
"Apache-2.0"
] | null | null | null | get-captcha.py | mmkhmmkh/Uni_Portal_Scraper | fb88eb57c9137f4f42805b43bb553f21d2d8f89c | [
"Apache-2.0"
] | 3 | 2019-10-21T10:18:52.000Z | 2021-09-11T12:38:51.000Z | import requests
import os
import cv2
import shutil
def main():
mainUrl = "https://portal.aut.ac.ir/aportal/index.jsp"
img_url = 'https://portal.aut.ac.ir/aportal/PassImageServlet'
pics_src = '/home/mahdi/Desktop/pics/'
if not os.path.isdir(pics_src):
os.makedirs(pics_src)
num = len(os.lis... | 29.621212 | 95 | 0.556522 | import requests
import os
import cv2
import shutil
def main():
mainUrl = "https://portal.aut.ac.ir/aportal/index.jsp"
img_url = 'https://portal.aut.ac.ir/aportal/PassImageServlet'
pics_src = '/home/mahdi/Desktop/pics/'
if not os.path.isdir(pics_src):
os.makedirs(pics_src)
num = len(os.lis... | true | true |
1c1747ff5072e7809a6be65dfbbd22b8b5f5ce4e | 215 | py | Python | sintable.py | hin/rpt | 6250536b64f266eee36d3119096c7a8a99df4a44 | [
"BSD-2-Clause"
] | null | null | null | sintable.py | hin/rpt | 6250536b64f266eee36d3119096c7a8a99df4a44 | [
"BSD-2-Clause"
] | null | null | null | sintable.py | hin/rpt | 6250536b64f266eee36d3119096c7a8a99df4a44 | [
"BSD-2-Clause"
] | null | null | null | import math
length = 1024
print '#include <stdint.h>'
print '#include <avr/pgmspace.h>'
print 'const int8_t sintable[] = {'
for i in range(length):
print ' %d,'%(127*math.sin(2*math.pi*i/length))
print '};'
| 19.545455 | 52 | 0.646512 | import math
length = 1024
print '#include <stdint.h>'
print '#include <avr/pgmspace.h>'
print 'const int8_t sintable[] = {'
for i in range(length):
print ' %d,'%(127*math.sin(2*math.pi*i/length))
print '};'
| false | true |
1c17497800e719e47a7b57b7645d4360d59e4382 | 4,402 | py | Python | python_target/FoxySheep/generated/FullFormListener.py | rljacobson/FoxySheep | 78451ba9f868d21f20f23ee880649f20669e7644 | [
"BSD-2-Clause"
] | 41 | 2016-02-08T12:35:11.000Z | 2021-11-17T11:45:47.000Z | python_target/FoxySheep/generated/FullFormListener.py | rljacobson/FoxySheep | 78451ba9f868d21f20f23ee880649f20669e7644 | [
"BSD-2-Clause"
] | 4 | 2020-09-09T20:43:34.000Z | 2021-01-21T22:32:26.000Z | python_target/FoxySheep/generated/FullFormListener.py | rljacobson/FoxySheep | 78451ba9f868d21f20f23ee880649f20669e7644 | [
"BSD-2-Clause"
] | 4 | 2017-08-20T01:04:10.000Z | 2021-08-07T19:51:52.000Z | # Generated from ../FullForm.g4 by ANTLR 4.7
from antlr4 import *
if __name__ is not None and "." in __name__:
from .FullFormParser import FullFormParser
else:
from FullFormParser import FullFormParser
# This class defines a complete listener for a parse tree produced by FullFormParser.
class FullFormListener(... | 34.390625 | 92 | 0.75602 | from antlr4 import *
if __name__ is not None and "." in __name__:
from .FullFormParser import FullFormParser
else:
from FullFormParser import FullFormParser
class FullFormListener(ParseTreeListener):
def enterProg(self, ctx:FullFormParser.ProgContext):
pass
def exitProg(self, ctx:Full... | true | true |
1c1749bc12647e4fc6e94015d7006dcc923aff88 | 575 | py | Python | fooof/tests/utils/test_params.py | varman-m/eeg_notebooks_doc | 12230719637c8087b020e8d5feeb20520a4da74d | [
"Apache-2.0"
] | 154 | 2018-11-05T16:50:21.000Z | 2022-03-31T12:02:33.000Z | fooof/tests/utils/test_params.py | Xawwell/fooof | 7a520c4f8ac3a44f4f18dc025b5e5d40049c9f2b | [
"Apache-2.0"
] | 128 | 2018-11-03T16:07:05.000Z | 2022-03-30T22:09:48.000Z | fooof/tests/utils/test_params.py | Xawwell/fooof | 7a520c4f8ac3a44f4f18dc025b5e5d40049c9f2b | [
"Apache-2.0"
] | 42 | 2019-01-31T17:24:58.000Z | 2022-02-19T00:00:58.000Z | """Test functions for fooof.utils.params."""
import numpy as np
from fooof.utils.params import *
###################################################################################################
###################################################################################################
def test_compute_kn... | 23 | 99 | 0.493913 |
import numpy as np
from fooof.utils.params import *
def test_compute_knee_frequency():
assert compute_knee_frequency(100, 2)
def test_compute_time_constant():
assert compute_time_constant(100)
def test_compute_fwhm():
assert compute_fwhm(1.5)
def test_compute_gauss_std():
assert compute_gauss... | true | true |
1c174b204b5351d227a8f40e97a99f877d373a00 | 12,192 | py | Python | dask/core.py | mmcky/dask | 6d58b523a53bee22a76ea9860ca1a131b2f9312d | [
"BSD-3-Clause"
] | 1 | 2021-02-16T06:12:20.000Z | 2021-02-16T06:12:20.000Z | dask/core.py | cruzdanilo/dask | 965c9e401801689a6a68cec5c0529f912a459960 | [
"BSD-3-Clause"
] | 1 | 2021-09-28T22:55:21.000Z | 2021-09-28T22:55:21.000Z | dask/core.py | jrbourbeau/dask | faad4375e0308ccf56998d02c2b3ca2c295a4263 | [
"BSD-3-Clause"
] | 1 | 2019-11-28T07:27:55.000Z | 2019-11-28T07:27:55.000Z | from __future__ import absolute_import, division, print_function
from itertools import chain
from .utils_test import add, inc # noqa: F401
def ishashable(x):
""" Is x hashable?
Examples
--------
>>> ishashable(1)
True
>>> ishashable([1])
False
"""
try:
hash(x)
... | 26.678337 | 84 | 0.519603 | from __future__ import absolute_import, division, print_function
from itertools import chain
from .utils_test import add, inc
def ishashable(x):
try:
hash(x)
return True
except TypeError:
return False
def istask(x):
return type(x) is tuple and x and callable(x[0])
def has_ta... | true | true |
1c174b301fa13b0de99a68f3cde47fb19700a9a0 | 2,598 | py | Python | controller/services_controller.py | rnanc/MOBYDATA | 4fb357660e767760ea3ccd12ce32452618b120a4 | [
"MIT"
] | null | null | null | controller/services_controller.py | rnanc/MOBYDATA | 4fb357660e767760ea3ccd12ce32452618b120a4 | [
"MIT"
] | null | null | null | controller/services_controller.py | rnanc/MOBYDATA | 4fb357660e767760ea3ccd12ce32452618b120a4 | [
"MIT"
] | 2 | 2020-03-16T13:39:58.000Z | 2021-03-27T17:22:40.000Z | from flask import request, Blueprint, render_template, redirect, url_for, Response
from flask_jwt_extended import jwt_required
import services.counter
import services.heat_map
import services.motion_heatmap
from werkzeug.utils import secure_filename
services_blueprint = Blueprint('services', __name__, template_folder='... | 43.3 | 218 | 0.714396 | from flask import request, Blueprint, render_template, redirect, url_for, Response
from flask_jwt_extended import jwt_required
import services.counter
import services.heat_map
import services.motion_heatmap
from werkzeug.utils import secure_filename
services_blueprint = Blueprint('services', __name__, template_folder='... | true | true |
1c174d4eb4469ecd2e70865da1c61368de991e3c | 1,832 | py | Python | tools/converters/update_inv.py | ImagiaViz/inviwo | a00bb6b0551bc1cf26dc0366c827c1a557a9603d | [
"BSD-2-Clause"
] | 349 | 2015-01-30T09:21:52.000Z | 2022-03-25T03:10:02.000Z | tools/converters/update_inv.py | liu3xing3long/inviwo | 69cca9b6ecd58037bda0ed9e6f53d02f189f19a7 | [
"BSD-2-Clause"
] | 641 | 2015-09-23T08:54:06.000Z | 2022-03-23T09:50:55.000Z | tools/converters/update_inv.py | liu3xing3long/inviwo | 69cca9b6ecd58037bda0ed9e6f53d02f189f19a7 | [
"BSD-2-Clause"
] | 124 | 2015-02-27T23:45:02.000Z | 2022-02-21T09:37:14.000Z | #requires lxml, and beautifulsoup4
#To install lxml
#Install lxml on Windows: https://pypi.python.org/pypi/lxml/3.3.3
#To install beautifulsoup4
#In Windows, run cmd as admin"
#Run "python get-pip.py" script to install pip
#Navigate to "PythonPath/Scripts"
#Run "pip install beautifulsoup4"
import sys
import os
from ... | 22.9 | 68 | 0.555131 |
#Run "python get-pip.py" script to install pip
#Navigate to "PythonPath/Scripts"
#Run "pip install beautifulsoup4"
import sys
import os
from bs4 import BeautifulSoup
def perform(f):
print("Open file " + f)
with open(f, 'r') as file:
filestr = "\n".join(file.readlines())
soup = BeautifulSoup(fi... | true | true |
1c174e0c22955684329a9d9acd240e502e4eba32 | 5,788 | py | Python | strategy/github/chougoushi_1.0.py | jypkkjj/rqalpha | f88be1112369c765054ba54512d1f7de3bc2ed47 | [
"Apache-2.0"
] | null | null | null | strategy/github/chougoushi_1.0.py | jypkkjj/rqalpha | f88be1112369c765054ba54512d1f7de3bc2ed47 | [
"Apache-2.0"
] | null | null | null | strategy/github/chougoushi_1.0.py | jypkkjj/rqalpha | f88be1112369c765054ba54512d1f7de3bc2ed47 | [
"Apache-2.0"
] | 1 | 2021-09-04T01:05:11.000Z | 2021-09-04T01:05:11.000Z | # 可以自己import我们平台支持的第三方python模块,比如pandas、numpy等。
#存在问题:如果一只股票已经买入了,但是被剔除出股票池,以后就不会再操作它。
#目标收益6%:4年累计25.958%
#
import talib
import numpy as np
import pandas as pd
# 在这个方法中编写任何的初始化逻辑。context对象将会在你的算法策略的任何方法之间做传递。
def init(context):
# 在context中保存全局变量
# context.s1 = "600600.XSHG"
context.SHORTPERIOD... | 40.475524 | 174 | 0.640809 | import talib
import numpy as np
import pandas as pd
def init(context):
context.SHORTPERIOD = 5
context.LONGPERIOD = 90
context.stocks = index_components('000300.XSHG')
logger.info("RunInfo: {}".format(context.run_info))
fundamental_df = get_fundamentals(
... | true | true |
1c174f57320d29a0c92cff513aa4b00dffe7ece9 | 2,822 | py | Python | networkx/readwrite/json_graph/jit.py | NeuroDataDesign/networkx | 857aa81ead611dd05c7445b53bd128131033d50e | [
"BSD-3-Clause"
] | null | null | null | networkx/readwrite/json_graph/jit.py | NeuroDataDesign/networkx | 857aa81ead611dd05c7445b53bd128131033d50e | [
"BSD-3-Clause"
] | 2 | 2019-11-13T03:48:53.000Z | 2021-02-15T16:52:09.000Z | networkx/readwrite/json_graph/jit.py | NeuroDataDesign/networkx | 857aa81ead611dd05c7445b53bd128131033d50e | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2011-2019 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
"""
Read and write NetworkX graphs as JavaScript InfoVis Toolkit (JIT) format JSON.
See the `JIT documentation`_ for more examples.
... | 25.196429 | 79 | 0.582211 |
import json
import networkx as nx
from networkx.utils.decorators import not_implemented_for
__all__ = ['jit_graph', 'jit_data']
def jit_graph(data, create_using=None):
if create_using is None:
G = nx.Graph()
else:
G = create_using
G.clear()
if isinstance(data, str):
dat... | true | true |
1c174f63547187c69f0abe1cdc36abda7f57be6e | 1,876 | py | Python | delta/data/preprocess/text_nlu_joint_preparer.py | awesome-archive/delta | 841d853cf0bdb479260be112432813dcb705f859 | [
"Apache-2.0"
] | 1 | 2021-01-11T13:25:19.000Z | 2021-01-11T13:25:19.000Z | delta/data/preprocess/text_nlu_joint_preparer.py | lhhriver/delta | a916e06f55213dcd1fea39a5950927dfed1483c7 | [
"Apache-2.0"
] | null | null | null | delta/data/preprocess/text_nlu_joint_preparer.py | lhhriver/delta | a916e06f55213dcd1fea39a5950927dfed1483c7 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.
# 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/LI... | 41.688889 | 80 | 0.670043 |
from delta.data.preprocess.base_preparer import TextPreparer
from delta.data import utils as data_utils
from delta.utils.register import registers
@registers.preparer.register
class TextNLUJointPreparer(TextPreparer):
def load_a_raw_file(self, one_path, mode, infer_without_label):
return data_utils.load_nlu_... | true | true |
1c17510196e67071dbd4fc27cab1abfdc76dec1b | 11,147 | py | Python | test/unit/config/test_config_values.py | Oddant1/galaxy | 5f3a2c4ce494c460a3ca6f297269a5b14f1a5162 | [
"CC-BY-3.0"
] | null | null | null | test/unit/config/test_config_values.py | Oddant1/galaxy | 5f3a2c4ce494c460a3ca6f297269a5b14f1a5162 | [
"CC-BY-3.0"
] | 1 | 2017-11-15T14:49:37.000Z | 2017-11-15T14:49:37.000Z | test/unit/config/test_config_values.py | xgaia/galaxy | 5f3a2c4ce494c460a3ca6f297269a5b14f1a5162 | [
"CC-BY-3.0"
] | null | null | null | import os
from collections import namedtuple
from datetime import timedelta
import pytest
from galaxy import config
from galaxy.util import listify
from galaxy.web.formatting import expand_pretty_datetime_format
TestData = namedtuple('TestData', ('key', 'expected', 'loaded'))
def listify_strip(value):
return l... | 49.542222 | 116 | 0.709608 | import os
from collections import namedtuple
from datetime import timedelta
import pytest
from galaxy import config
from galaxy.util import listify
from galaxy.web.formatting import expand_pretty_datetime_format
TestData = namedtuple('TestData', ('key', 'expected', 'loaded'))
def listify_strip(value):
return l... | true | true |
1c1751bbdc6c38c809db8b837458ace92490ea35 | 4,358 | py | Python | homework3-EM/code/em_algorithms.py | 0lidaxiang/IR | e4a7213f43e7aa2e332057b2b4b2bd98ceabf5be | [
"Apache-2.0"
] | 3 | 2018-03-16T08:44:08.000Z | 2020-02-04T08:07:44.000Z | homework3-EM/code/em_algorithms.py | 0lidaxiang/IR | e4a7213f43e7aa2e332057b2b4b2bd98ceabf5be | [
"Apache-2.0"
] | null | null | null | homework3-EM/code/em_algorithms.py | 0lidaxiang/IR | e4a7213f43e7aa2e332057b2b4b2bd98ceabf5be | [
"Apache-2.0"
] | 1 | 2019-11-20T09:22:37.000Z | 2019-11-20T09:22:37.000Z | #!/usr/bin/python3
# coding: utf-8
import numpy as np
import math
from datetime import datetime
import dictionary
import document
import wordDocsCount
import wordDocsNoCount
startInitial = datetime.now()
docList = document.getFilesName()
wordList = dictionary.getDictionary()
wNumber = len(wordList)
dNumber = len(do... | 34.314961 | 145 | 0.558743 |
import numpy as np
import math
from datetime import datetime
import dictionary
import document
import wordDocsCount
import wordDocsNoCount
startInitial = datetime.now()
docList = document.getFilesName()
wordList = dictionary.getDictionary()
wNumber = len(wordList)
dNumber = len(docList) topicNum = 10
P_d = np.rando... | true | true |
1c1751c20a5e349f25ae03072198b0bf30846e8b | 5,236 | py | Python | ControlPanel/controlpanel.py | Heck-R/Packages | 152f54a06a0f79d726646f08c87bea8a69df253e | [
"Zlib"
] | 91 | 2016-09-17T12:33:15.000Z | 2022-02-06T19:55:04.000Z | ControlPanel/controlpanel.py | Heck-R/Packages | 152f54a06a0f79d726646f08c87bea8a69df253e | [
"Zlib"
] | 40 | 2016-10-18T12:07:40.000Z | 2022-02-10T09:04:30.000Z | ControlPanel/controlpanel.py | Heck-R/Packages | 152f54a06a0f79d726646f08c87bea8a69df253e | [
"Zlib"
] | 49 | 2016-10-14T15:58:31.000Z | 2022-01-06T01:21:35.000Z | # Keypirinha: a fast launcher for Windows (keypirinha.com)
import keypirinha as kp
import keypirinha_util as kpu
import os.path
import winreg
class ControlPanel(kp.Plugin):
"""
Launch Windows' Control Panel items.
This plugin allows to search for and open system's Control Panels. A Control
... | 38.5 | 99 | 0.561688 |
import keypirinha as kp
import keypirinha_util as kpu
import os.path
import winreg
class ControlPanel(kp.Plugin):
panel_items = {}
def __init__(self):
super().__init__()
def on_catalog(self):
for cpi_clsid, cpi in self.panel_items.items():
if cpi['icon_... | true | true |
1c175315ff2ef7c62c121907df333d19e27abf5b | 4,956 | py | Python | python/qdlpy3/QdlPy/funcss.py | UofSC-QDEVS/shipsys | d01a8c8273aac916a1772a3d37db35faff68ea83 | [
"MIT"
] | null | null | null | python/qdlpy3/QdlPy/funcss.py | UofSC-QDEVS/shipsys | d01a8c8273aac916a1772a3d37db35faff68ea83 | [
"MIT"
] | null | null | null | python/qdlpy3/QdlPy/funcss.py | UofSC-QDEVS/shipsys | d01a8c8273aac916a1772a3d37db35faff68ea83 | [
"MIT"
] | null | null | null | """Delegate function-based State Space Framework.
"""
import lti
import numpy as np
import matplotlib.pyplot as plt
class FuncSystem(object):
def __init__(self, num_states, num_inputs, num_outputs):
self.n = num_states
self.m = num_inputs
self.p = num_outputs
self.x = FuncVecto... | 24.904523 | 77 | 0.567595 |
import lti
import numpy as np
import matplotlib.pyplot as plt
class FuncSystem(object):
def __init__(self, num_states, num_inputs, num_outputs):
self.n = num_states
self.m = num_inputs
self.p = num_outputs
self.x = FuncVector(self.n)
self.u = FuncVector(self.m)
... | true | true |
1c1753791a1ef7fe0a870771341169f305820950 | 204 | py | Python | Study_NumPy/6.py | hougeaaa/HappyDay | 60e226d380862db30b3c6abc1d7d7fbbcddd04a0 | [
"MIT"
] | 1 | 2020-03-19T10:01:53.000Z | 2020-03-19T10:01:53.000Z | Study_NumPy/6.py | hougeaaa/HappyDay | 60e226d380862db30b3c6abc1d7d7fbbcddd04a0 | [
"MIT"
] | null | null | null | Study_NumPy/6.py | hougeaaa/HappyDay | 60e226d380862db30b3c6abc1d7d7fbbcddd04a0 | [
"MIT"
] | null | null | null | import numpy as np
# 数组的 dtype 为 int8(一个字节)
x = np.array([1, 2, 3, 4, 5], dtype=np.int8)
print(x.itemsize)
# 数组的 dtype 现在为 float64(八个字节)
y = np.array([1, 2, 3, 4, 5], dtype=np.float64)
print(y.itemsize) | 22.666667 | 47 | 0.651961 | import numpy as np
x = np.array([1, 2, 3, 4, 5], dtype=np.int8)
print(x.itemsize)
y = np.array([1, 2, 3, 4, 5], dtype=np.float64)
print(y.itemsize) | true | true |
1c17541a7e61bf1dfa1cb6e538bedddb768af87d | 1,893 | py | Python | FasterRCNN/data/samplers/grouped_batch_sampler.py | pkyIntelligence/FasterRCNN | 230953938efdba8f8c127fcc0bb746fcce8d9463 | [
"MIT"
] | 377 | 2021-03-24T05:13:49.000Z | 2022-03-31T06:14:24.000Z | FasterRCNN/data/samplers/grouped_batch_sampler.py | pkyIntelligence/FasterRCNN | 230953938efdba8f8c127fcc0bb746fcce8d9463 | [
"MIT"
] | 89 | 2021-03-24T12:32:51.000Z | 2022-03-29T12:11:06.000Z | FasterRCNN/data/samplers/grouped_batch_sampler.py | pkyIntelligence/FasterRCNN | 230953938efdba8f8c127fcc0bb746fcce8d9463 | [
"MIT"
] | 51 | 2021-03-26T00:36:17.000Z | 2022-03-16T00:51:11.000Z | import numpy as np
from torch.utils.data.sampler import BatchSampler, Sampler
class GroupedBatchSampler(BatchSampler):
"""
Wraps another sampler to yield a mini-batch of indices.
It enforces that the batch only contain elements from the same group.
It also tries to provide mini-batches which follows a... | 40.276596 | 98 | 0.628104 | import numpy as np
from torch.utils.data.sampler import BatchSampler, Sampler
class GroupedBatchSampler(BatchSampler):
def __init__(self, sampler, group_ids, batch_size):
if not isinstance(sampler, Sampler):
raise ValueError(
"sampler should be an instance of "
... | true | true |
1c1754515cddc1d422443712582ae5009f8b894c | 7,394 | py | Python | examples/pwr_run/checkpointing/nonpc_short/timed_oracle/job3.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/nonpc_short/timed_oracle/job3.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/nonpc_short/timed_oracle/job3.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 31.733906 | 118 | 0.699621 |
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras.callbacks import ReduceLROn... | true | true |
1c1754dbf191154c2ac75cfe55bb6b25dd1e751f | 1,182 | py | Python | _unittests/ut_helpgen/test_notebook_report_coverage.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 18 | 2015-11-10T08:09:23.000Z | 2022-02-16T11:46:45.000Z | _unittests/ut_helpgen/test_notebook_report_coverage.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 321 | 2015-06-14T21:34:28.000Z | 2021-11-28T17:10:03.000Z | _unittests/ut_helpgen/test_notebook_report_coverage.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 10 | 2015-06-20T01:35:00.000Z | 2022-01-19T15:54:32.000Z | """
@brief test log(time=9s)
"""
import sys
import os
import unittest
from pyquickhelper.pycode import get_temp_folder
from pyquickhelper.loghelper import fLOG
from pyquickhelper.helpgen.process_notebooks import build_all_notebooks_coverage
class TestNotebookReportCoverage(unittest.TestCase):
def test_not... | 31.945946 | 80 | 0.628596 |
import sys
import os
import unittest
from pyquickhelper.pycode import get_temp_folder
from pyquickhelper.loghelper import fLOG
from pyquickhelper.helpgen.process_notebooks import build_all_notebooks_coverage
class TestNotebookReportCoverage(unittest.TestCase):
def test_notebook_report_coverage(self):
f... | true | true |
1c1754f5676c5abeffd6895680d947db535fac9e | 1,807 | py | Python | .history/ClassFiles/DataStructures/Dictionary_20210101170913.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/DataStructures/Dictionary_20210101170913.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/DataStructures/Dictionary_20210101170913.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | ''' Dictionary
A dictionary is a collection of key value pairs.
The values can be changed (mutable)
The values have unique keys.
Using the constructor method # 29
Built-in dictionary Methods
Method Description
get() Returns the value of a specific key. # 37
Update() Inser... | 30.627119 | 127 | 0.627559 | mycar = {
"brand": "Range Rover Sports",
"model": "HSE",
"year": 2017
}
print(mycar)
mygreens = dict(fruit="green apples", vegetables="kale")
print(mygreens)
print(len(mycar))
mycar["year"] = 2019
print(mycar)
print(mycar.get("year"))
mycar.update({"color": "silver"})
print(mycar)
b = mycar.key... | true | true |
1c17554509ccc3174c64c7ef5d8d9041cfe5d201 | 13,463 | py | Python | tools/gen_struct_info.py | emscripten-core/emscripten | 2213884b85ae8803f4a420349d55e44587364606 | [
"MIT"
] | 6,541 | 2019-01-17T22:13:18.000Z | 2022-03-31T07:20:21.000Z | tools/gen_struct_info.py | emscripten-core/emscripten | 2213884b85ae8803f4a420349d55e44587364606 | [
"MIT"
] | 7,584 | 2019-01-17T22:58:27.000Z | 2022-03-31T23:10:22.000Z | tools/gen_struct_info.py | emscripten-core/emscripten | 2213884b85ae8803f4a420349d55e44587364606 | [
"MIT"
] | 1,275 | 2019-01-19T16:18:04.000Z | 2022-03-30T19:32:35.000Z | #!/usr/bin/env python3
# coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""This tool extracts informati... | 29.524123 | 131 | 0.585754 |
import sys
import os
import re
import json
import argparse
import tempfile
import subprocess
sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from tools import shared
from tools import system_libs
from tools import utils
from tools.settings import settings
QUIET = (__name__ != '__mai... | true | true |
1c1755965a597e2b7d36d23b9d3c0c9409fea3d2 | 1,196 | py | Python | tests/test_storage_3/code.py | uuosio/python-contract-demos | 7d56ba371f2115b0ab895fca3e71092c2523f25d | [
"MIT"
] | 2 | 2020-12-08T13:15:06.000Z | 2020-12-29T10:06:44.000Z | tests/test_storage_3/code.py | uuosio/python-contract-demos | 7d56ba371f2115b0ab895fca3e71092c2523f25d | [
"MIT"
] | null | null | null | tests/test_storage_3/code.py | uuosio/python-contract-demos | 7d56ba371f2115b0ab895fca3e71092c2523f25d | [
"MIT"
] | null | null | null | import json
import chain
import db
class MyDataI256(object):
def __init__(self, a: int, b: int, c: int, d: float):
self.a = a
self.b = b
self.c = c
self.d = d
self.payer = 0
def pack(self):
data = (self.a, self.b, self.c, self.d)
return json.dumps(data)
... | 24.916667 | 83 | 0.630435 | import json
import chain
import db
class MyDataI256(object):
def __init__(self, a: int, b: int, c: int, d: float):
self.a = a
self.b = b
self.c = c
self.d = d
self.payer = 0
def pack(self):
data = (self.a, self.b, self.c, self.d)
return json.dumps(data)
... | true | true |
1c1756967edac7ab5fa3cb8d4ac907a9bd9553fb | 892 | py | Python | cap-4/18-atualizacao-de-banco-postgres.py | igoradriano/manipulacao-dados-python-bd | e3e47f15529d98e5c5887ebbb93c48924fceb665 | [
"MIT"
] | null | null | null | cap-4/18-atualizacao-de-banco-postgres.py | igoradriano/manipulacao-dados-python-bd | e3e47f15529d98e5c5887ebbb93c48924fceb665 | [
"MIT"
] | null | null | null | cap-4/18-atualizacao-de-banco-postgres.py | igoradriano/manipulacao-dados-python-bd | e3e47f15529d98e5c5887ebbb93c48924fceb665 | [
"MIT"
] | null | null | null | import psycopg2 as conector
# Criando uma conexão e um cursor
conexao = conector.connect(database='Aula4Python', user='postgres', password='051094', host='127.0.0.1', port='5432')
cursor = conexao.cursor()
print("conexão estabelecida com sucesso")
# Primeiro comando no Banco
cursor.execute("""SELECT * FROM "AGENDA" W... | 27.875 | 117 | 0.744395 | import psycopg2 as conector
conexao = conector.connect(database='Aula4Python', user='postgres', password='051094', host='127.0.0.1', port='5432')
cursor = conexao.cursor()
print("conexão estabelecida com sucesso")
cursor.execute("""SELECT * FROM "AGENDA" WHERE "id"=1""")
registro = cursor.fetchall()
print(registro)
... | true | true |
1c1757a3b84c63b691ab400e6edf1b1340c4312b | 1,464 | py | Python | aliyun-python-sdk-unimkt/aliyunsdkunimkt/request/v20181207/GetConsoleInfoRequest.py | liuzheng/aliyun-openapi-python-sdk | 1ba6743f3d6f2cef57ec9e3be1754b04293c3150 | [
"Apache-2.0"
] | 1 | 2021-03-08T02:59:17.000Z | 2021-03-08T02:59:17.000Z | aliyun-python-sdk-unimkt/aliyunsdkunimkt/request/v20181207/GetConsoleInfoRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-unimkt/aliyunsdkunimkt/request/v20181207/GetConsoleInfoRequest.py | bricklayer-Liu/aliyun-openapi-python-sdk | 20da2554de22679fc7c5462c483663e4d79512aa | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.538462 | 79 | 0.765027 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkunimkt.endpoint import endpoint_data
class GetConsoleInfoRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'UniMkt', '2018-12-07', 'GetConsoleInfo','uniMkt')
self.set_protocol_type('https')
self.set_method('POST')
if hasattr(self,... | true | true |
1c17583ea64f1142492b826d5bc82514f953b0da | 10,349 | py | Python | L1Trigger/GlobalTriggerAnalyzer/test/L1GtEmulTrigReport_cfg.py | m-sedghi/cmssw | 859df8affee372c53be79cdd2d8a5ff001eae841 | [
"Apache-2.0"
] | 1 | 2020-05-27T10:52:33.000Z | 2020-05-27T10:52:33.000Z | L1Trigger/GlobalTriggerAnalyzer/test/L1GtEmulTrigReport_cfg.py | m-sedghi/cmssw | 859df8affee372c53be79cdd2d8a5ff001eae841 | [
"Apache-2.0"
] | 28 | 2019-08-15T15:21:11.000Z | 2021-12-29T14:13:18.000Z | L1Trigger/GlobalTriggerAnalyzer/test/L1GtEmulTrigReport_cfg.py | m-sedghi/cmssw | 859df8affee372c53be79cdd2d8a5ff001eae841 | [
"Apache-2.0"
] | 1 | 2020-08-18T10:29:49.000Z | 2020-08-18T10:29:49.000Z | from __future__ import print_function
#
# cfg file to run L1 Global Trigger emulator on a file containing the output of the
# GCT system and GMT system ("digi"), followed by the L1 trigger report
# options set in "user choices"
#
#
# V M Ghete 2009-03-03
import FWCore.ParameterSet.Config as cms
import sys
process = ... | 38.472119 | 92 | 0.711856 | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import sys
process = cms.Process("L1GtEmulTrigReport")
print('\n')
from L1Trigger.GlobalTriggerAnalyzer.UserOptions_cff import *
if errorUserOptions == True :
print('\nError returned by UserOptions_cff\n')
sys.exit()
customL1Men... | true | true |
1c175acae1136ef89d240370e23f05acde36ef64 | 1,564 | py | Python | archive_for_wyko/Pyro-3.6/examples/agent2/agent/ShoppingAgent.py | ArcetriAdaptiveOptics/plico_interferometer_server | e14e240229c802333b2aa5bf6458a079dc950bd2 | [
"MIT"
] | null | null | null | archive_for_wyko/Pyro-3.6/examples/agent2/agent/ShoppingAgent.py | ArcetriAdaptiveOptics/plico_interferometer_server | e14e240229c802333b2aa5bf6458a079dc950bd2 | [
"MIT"
] | 3 | 2022-01-16T01:05:01.000Z | 2022-02-23T14:05:28.000Z | archive_for_wyko/Pyro-3.6/examples/agent2/agent/ShoppingAgent.py | ArcetriAdaptiveOptics/plico_interferometer_server | e14e240229c802333b2aa5bf6458a079dc950bd2 | [
"MIT"
] | 1 | 2022-01-14T14:04:07.000Z | 2022-01-14T14:04:07.000Z |
# this module contains the ShoppingAgent code
class ShoppingAgent:
def __init__(self, name):
self.name=name
self.productsToBuy=[]
self.productsBought={}
self.boughtObjects=[]
self.cash=0
self.shopsVisited=0
def shoppingList(self, products):
self.productsToBuy=products
def cashLimit(self,cash):
self... | 28.962963 | 51 | 0.688619 |
class ShoppingAgent:
def __init__(self, name):
self.name=name
self.productsToBuy=[]
self.productsBought={}
self.boughtObjects=[]
self.cash=0
self.shopsVisited=0
def shoppingList(self, products):
self.productsToBuy=products
def cashLimit(self,cash):
self.cash=cash
def visitShop(self, shop):
print... | false | true |
1c175b37806579666ecadb1d7ad23e3f3c5720de | 2,718 | py | Python | contrib/stack/stripmapStack/prepareUAVSAR_coregStack.py | earthobservatory/isce2 | 655c46cc4add275879167b750a5e91f6d00f168e | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-05-22T20:37:13.000Z | 2019-05-22T20:37:13.000Z | contrib/stack/stripmapStack/prepareUAVSAR_coregStack.py | earthobservatory/isce2 | 655c46cc4add275879167b750a5e91f6d00f168e | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | contrib/stack/stripmapStack/prepareUAVSAR_coregStack.py | earthobservatory/isce2 | 655c46cc4add275879167b750a5e91f6d00f168e | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-06-24T20:20:18.000Z | 2021-06-24T20:32:23.000Z | #!/usr/bin/env python3
import os
import glob
import argparse
import isce
import isceobj
import shelve
from isceobj.Util.decorators import use_api
def createParser():
'''
Create command line parser.
'''
parser = argparse.ArgumentParser(description='Unzip Alos zip files.')
parser.add_argument('-i... | 26.910891 | 123 | 0.613687 |
import os
import glob
import argparse
import isce
import isceobj
import shelve
from isceobj.Util.decorators import use_api
def createParser():
parser = argparse.ArgumentParser(description='Unzip Alos zip files.')
parser.add_argument('-i', '--input', dest='input', type=str, required=True,
help='... | true | true |
1c175b854857927108df9be77a2e12ababb6659f | 12,174 | py | Python | vendor/createrepo/genpkgmetadata.py | alekseysavitskiy/rpm-s3 | 981fb1724b381fd7437c1428e9454864b56262d5 | [
"BSD-2-Clause"
] | 59 | 2015-05-15T16:20:59.000Z | 2022-03-02T17:50:24.000Z | vendor/createrepo/genpkgmetadata.py | alekseysavitskiy/rpm-s3 | 981fb1724b381fd7437c1428e9454864b56262d5 | [
"BSD-2-Clause"
] | 21 | 2015-05-14T07:01:48.000Z | 2019-01-29T14:50:49.000Z | vendor/createrepo/genpkgmetadata.py | alekseysavitskiy/rpm-s3 | 981fb1724b381fd7437c1428e9454864b56262d5 | [
"BSD-2-Clause"
] | 44 | 2015-05-13T21:01:47.000Z | 2022-03-29T14:21:19.000Z | #!/usr/bin/python -t
# primary functions and glue for generating the repository metadata
#
# 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)... | 40.046053 | 93 | 0.626006 |
import os
import sys
import re
from optparse import OptionParser,SUPPRESS_HELP
import time
import errno
import createrepo
from createrepo import MDError
from createrepo.utils import errorprint, _
import yum.misc
def parse_args(args, conf):
"""
Parse the command line args. return a config object.
... | false | true |
1c175d26c433cc0243b4940d6f6b601f656d55fa | 6,094 | py | Python | tests/test_from_restdef.py | huntzhan/magic-constraints | 89e9f6df1f12a2de6637a46293e54c30b10bde0e | [
"MIT"
] | 35 | 2016-04-21T13:57:32.000Z | 2021-02-23T11:58:03.000Z | tests/test_from_restdef.py | huntzhan/magic-constraints | 89e9f6df1f12a2de6637a46293e54c30b10bde0e | [
"MIT"
] | 22 | 2016-04-20T17:42:08.000Z | 2016-06-01T04:10:18.000Z | tests/test_from_restdef.py | huntzhan/magic-constraints | 89e9f6df1f12a2de6637a46293e54c30b10bde0e | [
"MIT"
] | 2 | 2016-04-25T06:16:55.000Z | 2016-06-01T03:39:38.000Z | # -*- coding: utf-8 -*-
from __future__ import (
division, absolute_import, print_function, unicode_literals,
)
from builtins import * # noqa
from future.builtins.disabled import * # noqa
import pytest
from magic_constraints import * # noqa
def test_on_init():
@class_initialization_const... | 19.915033 | 66 | 0.530522 | from __future__ import (
division, absolute_import, print_function, unicode_literals,
)
from builtins import * from future.builtins.disabled import *
import pytest
from magic_constraints import *
def test_on_init():
@class_initialization_constraints
class Case(object):
INIT_... | true | true |
1c175dc879afcdf8ee7907e7f1442070e917dea1 | 7,852 | py | Python | wikiconfig.py | danirus/moinmoin-wiki | ad6fedf52e291ed6bbb36e6510e11091c0021fe6 | [
"MIT"
] | null | null | null | wikiconfig.py | danirus/moinmoin-wiki | ad6fedf52e291ed6bbb36e6510e11091c0021fe6 | [
"MIT"
] | null | null | null | wikiconfig.py | danirus/moinmoin-wiki | ad6fedf52e291ed6bbb36e6510e11091c0021fe6 | [
"MIT"
] | null | null | null | # -*- coding: iso-8859-1 -*-
# IMPORTANT! This encoding (charset) setting MUST be correct! If you live in a
# western country and you don't know that you use utf-8, you probably want to
# use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode
# encoding) you MUST use: coding: utf-8
# That setting must ... | 41.326316 | 100 | 0.658049 | # use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode
# encoding) you MUST use: coding: utf-8
# That setting must match the encoding your editor uses when you modify the
# settings below. If it does not, special non-ASCII chars will be wrong.
"""
MoinMoin - Configuration for a single wiki
... | false | true |
1c175ed3392e0b413da16dfa3d0f55232598b239 | 590 | py | Python | requestdemo/2.request_addheader.py | liang1024/CrawlerDemo | f9b93d062477ff96c31decc600f35e2dc84d27e4 | [
"Apache-2.0"
] | null | null | null | requestdemo/2.request_addheader.py | liang1024/CrawlerDemo | f9b93d062477ff96c31decc600f35e2dc84d27e4 | [
"Apache-2.0"
] | null | null | null | requestdemo/2.request_addheader.py | liang1024/CrawlerDemo | f9b93d062477ff96c31decc600f35e2dc84d27e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
'''
使用request为请求添加header
'''
import requests
kw = {'wd':'权利的游戏'}
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"}
# params 接收一个字典或者字符串的查询参数,字典类型自动转换为url编码,不需要urlencode()
response = requests.get("http://www.b... | 21.071429 | 142 | 0.752542 | '''
使用request为请求添加header
'''
import requests
kw = {'wd':'权利的游戏'}
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"}
response = requests.get("http://www.baidu.com/s?", params = kw, headers = headers)
print response.text
pri... | false | true |
1c17611c9a0a29fca94e061e4813cd08e6d36798 | 435 | py | Python | Platforms/Web/Processing/Api/Discord/Configs/Gameenabledchannels/__init__.py | The-CJ/Phaazebot | 83a9563d210718071d4e2cdcca3b212c87abaf51 | [
"MIT"
] | 2 | 2017-09-14T08:07:55.000Z | 2021-05-18T05:05:05.000Z | Platforms/Web/Processing/Api/Discord/Configs/Gameenabledchannels/__init__.py | The-CJ/Phaazebot | 83a9563d210718071d4e2cdcca3b212c87abaf51 | [
"MIT"
] | 111 | 2018-04-15T14:32:14.000Z | 2021-03-28T21:06:29.000Z | Platforms/Web/Processing/Api/Discord/Configs/Gameenabledchannels/__init__.py | The-CJ/Phaazebot | 83a9563d210718071d4e2cdcca3b212c87abaf51 | [
"MIT"
] | 1 | 2018-04-15T13:24:44.000Z | 2018-04-15T13:24:44.000Z | import Platforms.Web.Processing.Api.Discord.Configs.Gameenabledchannels.create as create
import Platforms.Web.Processing.Api.Discord.Configs.Gameenabledchannels.delete as delete
import Platforms.Web.Processing.Api.Discord.Configs.Gameenabledchannels.errors as errors
import Platforms.Web.Processing.Api.Discord.Configs.G... | 72.5 | 88 | 0.873563 | import Platforms.Web.Processing.Api.Discord.Configs.Gameenabledchannels.create as create
import Platforms.Web.Processing.Api.Discord.Configs.Gameenabledchannels.delete as delete
import Platforms.Web.Processing.Api.Discord.Configs.Gameenabledchannels.errors as errors
import Platforms.Web.Processing.Api.Discord.Configs.G... | true | true |
1c1762c8ad20949427e7a540afab16d1a42370e8 | 13,174 | py | Python | pynet/models/braingengan.py | claireguichon/pynet | 92706375e61fb5cb523548303b7d04769c9de134 | [
"CECILL-B"
] | 8 | 2020-06-23T16:30:52.000Z | 2021-07-27T15:07:18.000Z | pynet/models/braingengan.py | claireguichon/pynet | 92706375e61fb5cb523548303b7d04769c9de134 | [
"CECILL-B"
] | 8 | 2019-12-18T17:28:47.000Z | 2021-02-12T09:10:58.000Z | pynet/models/braingengan.py | claireguichon/pynet | 92706375e61fb5cb523548303b7d04769c9de134 | [
"CECILL-B"
] | 18 | 2019-08-19T14:17:48.000Z | 2021-12-20T03:56:39.000Z | # -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2020
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... | 37.214689 | 76 | 0.587141 |
import logging
import collections
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as func
from pynet.utils import Networks
logger = logging.getLogger("pynet")
@Networks.register
class BGDiscriminator(nn.Module):
def __init__(self, in_shape, ... | true | true |
1c1762f853ebdabc1a1604f208c4d749017a18c8 | 161 | py | Python | ch5/gen.map.py | ldmcdaniel/learning_python | 63717c397cd75e45a8aef909d4b601466cd6036a | [
"MIT"
] | 30 | 2016-10-28T18:14:15.000Z | 2021-08-29T15:20:56.000Z | ch5/gen.map.py | ldmcdaniel/learning_python | 63717c397cd75e45a8aef909d4b601466cd6036a | [
"MIT"
] | null | null | null | ch5/gen.map.py | ldmcdaniel/learning_python | 63717c397cd75e45a8aef909d4b601466cd6036a | [
"MIT"
] | 31 | 2016-09-10T22:47:12.000Z | 2022-03-13T04:50:35.000Z | def adder(*n):
return sum(n)
s1 = sum(map(lambda n: adder(*n), zip(range(100), range(1, 101))))
s2 = sum(adder(*n) for n in zip(range(100), range(1, 101)))
| 26.833333 | 66 | 0.602484 | def adder(*n):
return sum(n)
s1 = sum(map(lambda n: adder(*n), zip(range(100), range(1, 101))))
s2 = sum(adder(*n) for n in zip(range(100), range(1, 101)))
| true | true |
1c17631f35426d056f4f5761fe44f022d0599485 | 895 | py | Python | src/feature_extractor.py | yilmazbaysal/Fashion-Classifier | 79cced68c83c32bda275a003a55b1a7cfdbc845a | [
"MIT"
] | null | null | null | src/feature_extractor.py | yilmazbaysal/Fashion-Classifier | 79cced68c83c32bda275a003a55b1a7cfdbc845a | [
"MIT"
] | null | null | null | src/feature_extractor.py | yilmazbaysal/Fashion-Classifier | 79cced68c83c32bda275a003a55b1a7cfdbc845a | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from keras import Model
from keras.applications import VGG16
from keras.preprocessing import image
from keras.applications.vgg16 import preprocess_input
class FeatureExtractor:
def __init__(self):
self.model = VGG16(weights='imagenet', include_top=True)
def extract_feat... | 30.862069 | 108 | 0.715084 | import cv2
import numpy as np
from keras import Model
from keras.applications import VGG16
from keras.preprocessing import image
from keras.applications.vgg16 import preprocess_input
class FeatureExtractor:
def __init__(self):
self.model = VGG16(weights='imagenet', include_top=True)
def extract_feat... | true | true |
1c17637dd6c7ad3dc78952023cc9d262ecdc1df9 | 8,753 | py | Python | cs20si/tf-stanford-tutorials/assignments/style_transfer/style_transfer_sols.py | kabrapratik28/Stanford_courses | 9b02845ad15103d7e7f934319f43298f8cd8a364 | [
"Apache-2.0"
] | 1 | 2017-07-12T18:34:29.000Z | 2017-07-12T18:34:29.000Z | cs20si/tf-stanford-tutorials/assignments/style_transfer/style_transfer_sols.py | kabrapratik28/Stanford_courses | 9b02845ad15103d7e7f934319f43298f8cd8a364 | [
"Apache-2.0"
] | null | null | null | cs20si/tf-stanford-tutorials/assignments/style_transfer/style_transfer_sols.py | kabrapratik28/Stanford_courses | 9b02845ad15103d7e7f934319f43298f8cd8a364 | [
"Apache-2.0"
] | null | null | null | """ An implementation of the paper "A Neural Algorithm of Artistic Style"
by Gatys et al. in TensorFlow.
Author: Chip Huyen (huyenn@stanford.edu)
Prepared for the class CS 20SI: "TensorFlow for Deep Learning Research"
For more details, please read the assignment handout:
http://web.stanford.edu/class/cs20si/assignment... | 40.336406 | 106 | 0.618874 | from __future__ import print_function
import os
import time
import numpy as np
import tensorflow as tf
import vgg_model
import utils
STYLE = 'guernica'
CONTENT = 'deadpool'
STYLE_IMAGE = 'styles/' + STYLE + '.jpg'
CONTENT_IMAGE = 'content/' + CONTENT + '.jpg'
IMAGE_HEIGHT = 250
IMAGE_WIDTH = 333
NOISE_RATIO = 0.6
... | true | true |
1c1763d171af62051633288273b9976f7084066e | 36,503 | py | Python | run.py | TheKharleeci/suricata-verify | cabedf66aa2dbb4c68b4061e227047508919922a | [
"MIT"
] | null | null | null | run.py | TheKharleeci/suricata-verify | cabedf66aa2dbb4c68b4061e227047508919922a | [
"MIT"
] | null | null | null | run.py | TheKharleeci/suricata-verify | cabedf66aa2dbb4c68b4061e227047508919922a | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
#
# Copyright (C) 2017-2021 Open Information Security Foundation
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation ... | 34.534532 | 154 | 0.5539 |
from __future__ import print_function
import sys
import os
import os.path
import subprocess
import threading
import shutil
import string
import argparse
import yaml
import glob
import re
import json
import unittest
import multiprocessing as mp
from collections import namedtuple
import threading
import filecmp
import ... | true | true |
1c1765569109ad2e675b8c2c07ac605ed697cf62 | 790 | py | Python | 5.SingleNum/single_num.py | VVgege/leetcode | 83daffa701f60e3f19a770287b4b03e52e102e38 | [
"Unlicense"
] | null | null | null | 5.SingleNum/single_num.py | VVgege/leetcode | 83daffa701f60e3f19a770287b4b03e52e102e38 | [
"Unlicense"
] | null | null | null | 5.SingleNum/single_num.py | VVgege/leetcode | 83daffa701f60e3f19a770287b4b03e52e102e38 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
# File Name: 5.SingleNum/single_num.py
# Developer: VVgege
# Data: Tue Feb 3 22:30:56 2015
'''
Question
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it wi... | 25.483871 | 106 | 0.655696 | '''
Question
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
'''
class solution(object):
def __init__(self, list_a=[]):
self.list_a = list_a
de... | false | true |
1c1768115673fd78039e9080ee3fb1ebe3374205 | 33,638 | py | Python | examples/transformer-xl/mem_transformer.py | shjwudp/fastmoe_shen | f4857a9712a78b494b7e940e918a5d016f63bcf4 | [
"Apache-2.0"
] | 6 | 2021-08-16T09:40:16.000Z | 2021-10-17T02:07:43.000Z | examples/transformer-xl/mem_transformer.py | knitvoger/fastmoe | b861e928000ddf1a94bb5f795e6286769e743bd9 | [
"Apache-2.0"
] | 1 | 2021-05-24T03:13:50.000Z | 2021-05-24T03:13:50.000Z | examples/transformer-xl/mem_transformer.py | knitvoger/fastmoe | b861e928000ddf1a94bb5f795e6286769e743bd9 | [
"Apache-2.0"
] | 1 | 2021-11-19T07:49:35.000Z | 2021-11-19T07:49:35.000Z | import sys
import math
import functools
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
sys.path.append('utils')
from proj_adaptive_softmax import ProjectedAdaptiveLogSoftmax, Projection
from log_uniform_sampler import LogUniformSampler, sample_logits
class PositionalEmbedding(... | 38.708861 | 110 | 0.561686 | import sys
import math
import functools
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
sys.path.append('utils')
from proj_adaptive_softmax import ProjectedAdaptiveLogSoftmax, Projection
from log_uniform_sampler import LogUniformSampler, sample_logits
class PositionalEmbedding(... | true | true |
1c176847fee9afa5f8e05043293f14112e01b8c9 | 1,209 | py | Python | evolution/methods/gs.py | HaolingZHANG/ReverseEncodingTree | 16558ae18d71e7b1f089bfc6f4d819ad017d0f25 | [
"Apache-2.0"
] | 14 | 2020-02-11T11:45:07.000Z | 2022-03-10T23:47:45.000Z | evolution/methods/gs.py | HaolingZHANG/ReverseEncodingTree | 16558ae18d71e7b1f089bfc6f4d819ad017d0f25 | [
"Apache-2.0"
] | 2 | 2020-02-02T10:49:51.000Z | 2020-07-19T10:37:32.000Z | evolution/methods/gs.py | HaolingZHANG/ReverseEncodingTree | 16558ae18d71e7b1f089bfc6f4d819ad017d0f25 | [
"Apache-2.0"
] | null | null | null | """
Name: NEAT evolved by Golden-Section Search
Function(s):
Reproduction by Golden-Section Search and Random Near Search.
"""
from ReverseEncodingTree.evolution.bean.genome import create_golden_section_new
from ReverseEncodingTree.evolution.methods import bi
class Reproduction(bi.Reproduction):
d... | 34.542857 | 113 | 0.688999 |
from ReverseEncodingTree.evolution.bean.genome import create_golden_section_new
from ReverseEncodingTree.evolution.methods import bi
class Reproduction(bi.Reproduction):
def obtain_global_genome(self, matrix_1, matrix_2, saved_genomes, index):
center_genome = create_golden_section_new(matrix_1, ... | true | true |
1c17685a382a9fd005e7a750191f9854d559a585 | 3,507 | py | Python | qiskit/circuit/library/standard_gates/rzz.py | godspeed5/qiskit-terra | a5d87c3e4a663ab962704585fba0caef15061246 | [
"Apache-2.0"
] | 15 | 2020-06-29T08:33:39.000Z | 2022-02-12T00:28:51.000Z | qiskit/circuit/library/standard_gates/rzz.py | godspeed5/qiskit-terra | a5d87c3e4a663ab962704585fba0caef15061246 | [
"Apache-2.0"
] | 35 | 2019-03-07T02:09:22.000Z | 2022-03-22T19:55:15.000Z | qiskit/circuit/library/standard_gates/rzz.py | godspeed5/qiskit-terra | a5d87c3e4a663ab962704585fba0caef15061246 | [
"Apache-2.0"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# 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 derivative wo... | 29.470588 | 82 | 0.478472 |
from qiskit.circuit.gate import Gate
from qiskit.circuit.quantumregister import QuantumRegister
class RZZGate(Gate):
def __init__(self, theta):
super().__init__('rzz', 2, [theta])
def _define(self):
from qiskit.circuit.quantumcircuit import QuantumCircuit
from .x import CXG... | true | true |
1c17690bda9cdd6636bb4c79610d867a42f639c5 | 1,016 | py | Python | tests/test_metadata.py | dk107dk/cdocs | a0e4e66dc1ccb52534c93a637f3cb1eae3916d42 | [
"MIT"
] | 1 | 2020-11-07T12:12:02.000Z | 2020-11-07T12:12:02.000Z | tests/test_metadata.py | dk107dk/cdocs | a0e4e66dc1ccb52534c93a637f3cb1eae3916d42 | [
"MIT"
] | 5 | 2020-09-25T07:08:30.000Z | 2021-06-25T15:42:20.000Z | tests/test_metadata.py | dk107dk/cdocs | a0e4e66dc1ccb52534c93a637f3cb1eae3916d42 | [
"MIT"
] | null | null | null | from cdocs.context_metadata import ContextMetadata
import unittest
import os
class MetadataTests(unittest.TestCase):
noise = False
def _print(self, text:str) -> None:
if self.noise:
print(text)
def off(self) -> bool:
return False
def test_formats(self):
self._prin... | 35.034483 | 98 | 0.655512 | from cdocs.context_metadata import ContextMetadata
import unittest
import os
class MetadataTests(unittest.TestCase):
noise = False
def _print(self, text:str) -> None:
if self.noise:
print(text)
def off(self) -> bool:
return False
def test_formats(self):
self._prin... | true | true |
1c17693546d8b4c7b1b199b46efd83ce03a14803 | 932 | py | Python | barracuda_waf/komand_barracuda_waf/actions/delete_security_policy/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | barracuda_waf/komand_barracuda_waf/actions/delete_security_policy/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | barracuda_waf/komand_barracuda_waf/actions/delete_security_policy/schema.py | xhennessy-r7/insightconnect-plugins | 59268051313d67735b5dd3a30222eccb92aca8e9 | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Input:
ID = "id"
class Output:
MSG = "msg"
class DeleteSecurityPolicyInput(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variables",
"properties": {
"id": {
"type": "string",
... | 16.068966 | 57 | 0.538627 | import komand
import json
class Input:
ID = "id"
class Output:
MSG = "msg"
class DeleteSecurityPolicyInput(komand.Input):
schema = json.loads("""
{
"type": "object",
"title": "Variables",
"properties": {
"id": {
"type": "string",
"title": "Id",
"description": "ID... | true | true |
1c176a680d013e318de104cd231d7806271a2962 | 10,322 | py | Python | tests/quantization/test_hw_config.py | l-bat/nncf | 6258916cd5fa7fc010ad09da63113354358bffd8 | [
"Apache-2.0"
] | null | null | null | tests/quantization/test_hw_config.py | l-bat/nncf | 6258916cd5fa7fc010ad09da63113354358bffd8 | [
"Apache-2.0"
] | null | null | null | tests/quantization/test_hw_config.py | l-bat/nncf | 6258916cd5fa7fc010ad09da63113354358bffd8 | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2019-2020 Intel Corporation
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 w... | 42.829876 | 116 | 0.558031 |
import torch
from nncf.dynamic_graph.graph_tracer import ModelInputInfo
from nncf.common.graph.graph import MODEL_INPUT_OP_NAME
from nncf.hw_config import HWConfig
from nncf.nncf_network import NNCFNetwork
from nncf.quantization.algo import QuantizationBuilder, QuantizationController, QuantizerSetupGeneratorBase
fro... | true | true |
1c176b38ec7881ff26043385459b3e9fd037390b | 7,653 | py | Python | script/_Utility.py | kibalab/KIBA-TION-CODE- | 6d5c4d6ed958b61a9b014cf4bf51511e45e0309a | [
"MIT"
] | 1 | 2018-06-12T07:13:03.000Z | 2018-06-12T07:13:03.000Z | script/_Utility.py | kibalab/KIBA-TION-CODE- | 6d5c4d6ed958b61a9b014cf4bf51511e45e0309a | [
"MIT"
] | null | null | null | script/_Utility.py | kibalab/KIBA-TION-CODE- | 6d5c4d6ed958b61a9b014cf4bf51511e45e0309a | [
"MIT"
] | null | null | null | import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import bot
import asyncio
import discord
commands = bot.commands
if not discord.opus.is_loaded():
# the 'opus' library he... | 42.516667 | 122 | 0.57533 | import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import bot
import asyncio
import discord
commands = bot.commands
if not discord.opus.is_loaded():
dis... | true | true |
1c176dc8059768dbf3952b52dab48a5804ea4b12 | 9,188 | py | Python | chainer_chemistry/models/cwle/cwle_graph_conv_model.py | pfnet/chainerchem | efe323aa21f63a815130d673781e7cca1ccb72d2 | [
"MIT"
] | 184 | 2019-11-27T12:59:01.000Z | 2022-03-29T19:18:54.000Z | chainer_chemistry/models/cwle/cwle_graph_conv_model.py | pfnet/chainerchem | efe323aa21f63a815130d673781e7cca1ccb72d2 | [
"MIT"
] | 21 | 2019-12-08T01:53:33.000Z | 2020-10-23T01:19:56.000Z | chainer_chemistry/models/cwle/cwle_graph_conv_model.py | pfnet/chainerchem | efe323aa21f63a815130d673781e7cca1ccb72d2 | [
"MIT"
] | 45 | 2019-11-28T09:59:54.000Z | 2022-02-07T02:42:46.000Z | import chainer
from chainer import cuda
from chainer import links
from chainer import functions
from chainer_chemistry.links.connection.embed_atom_id import EmbedAtomID
from chainer_chemistry.links.connection.graph_linear import GraphLinear
from chainer_chemistry.links.normalization.graph_batch_normalization import Gr... | 40.654867 | 107 | 0.616239 | import chainer
from chainer import cuda
from chainer import links
from chainer import functions
from chainer_chemistry.links.connection.embed_atom_id import EmbedAtomID
from chainer_chemistry.links.connection.graph_linear import GraphLinear
from chainer_chemistry.links.normalization.graph_batch_normalization import Gr... | true | true |
1c176fc123c1e956a60e432e8f77fa990436028f | 6,573 | py | Python | losantrest/integrations.py | Losant/losant-rest-python | 50a6ce13dfef7acefb930fe45893c7bae862f784 | [
"MIT"
] | 5 | 2016-06-16T20:18:11.000Z | 2022-03-09T11:41:59.000Z | losantrest/integrations.py | Losant/losant-rest-python | 50a6ce13dfef7acefb930fe45893c7bae862f784 | [
"MIT"
] | 4 | 2021-07-13T06:09:16.000Z | 2022-03-07T14:24:49.000Z | losantrest/integrations.py | Losant/losant-rest-python | 50a6ce13dfef7acefb930fe45893c7bae862f784 | [
"MIT"
] | 6 | 2016-11-18T03:19:17.000Z | 2022-03-09T11:41:47.000Z | """
The MIT License (MIT)
Copyright (c) 2021 Losant IoT, 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, me... | 44.412162 | 150 | 0.663472 |
import json
class Integrations(object):
def __init__(self, client):
self.client = client
def get(self, **kwargs):
query_params = {"_actions": "false", "_links": "true", "_embedded": "true"}
path_params = {}
headers = {}
body = None
if "applicationId" in kw... | true | true |
1c17700ac5294a9a4f3c2de5b8622a84eb586e5c | 20,795 | py | Python | tests/integration/test_events.py | cknave/localstack | 67941331c74dded97284698aba64984ab69cdf43 | [
"Apache-2.0"
] | 1 | 2020-05-23T06:09:38.000Z | 2020-05-23T06:09:38.000Z | tests/integration/test_events.py | cknave/localstack | 67941331c74dded97284698aba64984ab69cdf43 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_events.py | cknave/localstack | 67941331c74dded97284698aba64984ab69cdf43 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import json
import uuid
import unittest
from localstack import config
from localstack.services.awslambda.lambda_api import LAMBDA_RUNTIME_PYTHON36
from localstack.services.events.events_listener import EVENTS_TMP_DIR
from localstack.services.generic_proxy import ProxyListener
from loca... | 35.365646 | 120 | 0.590815 | import os
import json
import uuid
import unittest
from localstack import config
from localstack.services.awslambda.lambda_api import LAMBDA_RUNTIME_PYTHON36
from localstack.services.events.events_listener import EVENTS_TMP_DIR
from localstack.services.generic_proxy import ProxyListener
from localstack.services.infra im... | true | true |
1c1770a8b889135a17c9167ba1a2f9502eab943e | 411 | py | Python | incidentreports/manage.py | sfogle/incident-reports | 75d22fb3a1f302fc4a59acb1ba5f2b15da3785b1 | [
"Apache-2.0"
] | null | null | null | incidentreports/manage.py | sfogle/incident-reports | 75d22fb3a1f302fc4a59acb1ba5f2b15da3785b1 | [
"Apache-2.0"
] | null | null | null | incidentreports/manage.py | sfogle/incident-reports | 75d22fb3a1f302fc4a59acb1ba5f2b15da3785b1 | [
"Apache-2.0"
] | null | null | null | # Set the path
import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from flask.ext.script import Manager, Server
from incidentreports import app
manager = Manager(app)
# Turn on debugger by default and reloader
manager.add_command("runserver", Server(
use_debugger=True,
... | 21.631579 | 79 | 0.717762 | import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from flask.ext.script import Manager, Server
from incidentreports import app
manager = Manager(app)
manager.add_command("runserver", Server(
use_debugger=True,
use_reloader=True,
host='0.0.0.0')
)
if __name__ ... | true | true |
1c17713b68753d7987778f72505623e472d43d1f | 345 | py | Python | util/logger.py | kkt86/TradingEnv | 3d1d26a9c21b57801029950c9b8294e8d3fac2dd | [
"MIT"
] | null | null | null | util/logger.py | kkt86/TradingEnv | 3d1d26a9c21b57801029950c9b8294e8d3fac2dd | [
"MIT"
] | null | null | null | util/logger.py | kkt86/TradingEnv | 3d1d26a9c21b57801029950c9b8294e8d3fac2dd | [
"MIT"
] | null | null | null | import logging
def get_logger(name, level=logging.DEBUG):
logger = logging.getLogger(name)
logger.setLevel(level)
ch = logging.StreamHandler()
ch.setLevel(level)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandl... | 26.538462 | 89 | 0.689855 | import logging
def get_logger(name, level=logging.DEBUG):
logger = logging.getLogger(name)
logger.setLevel(level)
ch = logging.StreamHandler()
ch.setLevel(level)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandl... | true | true |
1c177495cc24e00283bc095441ac626eef1cc3c2 | 106,313 | py | Python | theano/compile/debugmode.py | abhishekkrthakur/Theano | c5d3942b7e16fa8b425a3e09079b8056603b0c99 | [
"BSD-3-Clause"
] | null | null | null | theano/compile/debugmode.py | abhishekkrthakur/Theano | c5d3942b7e16fa8b425a3e09079b8056603b0c99 | [
"BSD-3-Clause"
] | null | null | null | theano/compile/debugmode.py | abhishekkrthakur/Theano | c5d3942b7e16fa8b425a3e09079b8056603b0c99 | [
"BSD-3-Clause"
] | 1 | 2020-07-30T16:55:30.000Z | 2020-07-30T16:55:30.000Z | """
Provides `DebugMode`, an evaluation mode for debugging theano internals.
TODO: add support for IfElse Op, LazyLinker, PureOp, etc.
"""
from __future__ import absolute_import, print_function, division
import copy
import sys
import gc
import logging
import six.moves.copyreg as copyreg
from itertools import chain, ... | 38.885516 | 89 | 0.530199 | from __future__ import absolute_import, print_function, division
import copy
import sys
import gc
import logging
import six.moves.copyreg as copyreg
from itertools import chain, product as itertools_product
from theano.compat import izip
import numpy
import theano
from theano import gof, config
from theano.compat im... | true | true |
1c177506b4e6b9484eced6c81d37f5ae8c660e22 | 6,393 | py | Python | SUL_torch/example/HRNet/hrnet.py | ddddwee1/SULT | 0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784 | [
"WTFPL"
] | 18 | 2017-12-19T07:55:17.000Z | 2020-03-12T11:07:45.000Z | SUL_torch/example/HRNet/hrnet.py | ddddwee1/SULT | 0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784 | [
"WTFPL"
] | 1 | 2020-10-20T06:33:53.000Z | 2020-10-26T19:01:21.000Z | SUL_torch/example/HRNet/hrnet.py | ddddwee1/SULT | 0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784 | [
"WTFPL"
] | 5 | 2018-06-06T00:51:48.000Z | 2020-03-12T11:07:46.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import Model as M
import numpy as np
class ResUnit(M.Model):
def initialize(self, out, stride, shortcut=False):
self.shortcut = shortcut
self.c1 = M.ConvLayer(1, out//4, usebias=False, activation=M.PARAM_RELU, batch_norm=True)
self.c2 = M.C... | 30.735577 | 125 | 0.6687 | import torch
import torch.nn as nn
import torch.nn.functional as F
import Model as M
import numpy as np
class ResUnit(M.Model):
def initialize(self, out, stride, shortcut=False):
self.shortcut = shortcut
self.c1 = M.ConvLayer(1, out//4, usebias=False, activation=M.PARAM_RELU, batch_norm=True)
self.c2 = M.C... | true | true |
1c17752037fd8b69a1efa646b80c842cd0a806b8 | 390 | py | Python | aoj/volumn5/0532/0532aoj.py | punkieL/proCon | 7e994d67e5efdf7ac0b1bee5e0b19b317f07e8af | [
"MIT"
] | 1 | 2015-10-06T16:27:42.000Z | 2015-10-06T16:27:42.000Z | aoj/volumn5/0532/0532aoj.py | punkieL/proCon | 7e994d67e5efdf7ac0b1bee5e0b19b317f07e8af | [
"MIT"
] | 1 | 2016-03-02T16:18:11.000Z | 2016-03-02T16:18:11.000Z | aoj/volumn5/0532/0532aoj.py | punkieL/proCon | 7e994d67e5efdf7ac0b1bee5e0b19b317f07e8af | [
"MIT"
] | null | null | null | #python3
'''
'''
import sys
while 1:
try:
h1,m1,s1,h2,m2,s2=map(int,input().split())
except EOFError: break
'''<- this is /* in c/c++
m1=input()
s1=input()
h2=input()
m2=input()
s2=input()
'''
s1=s2+60-s1
s2=s1%60
s1=s1/60
m1=m2+60-1-m1+s1
m2=m1%60
m1=m1/60
h2=h2-h1-1+m1
#pr... | 13.448276 | 46 | 0.525641 | import sys
while 1:
try:
h1,m1,s1,h2,m2,s2=map(int,input().split())
except EOFError: break
s1=s2+60-s1
s2=s1%60
s1=s1/60
m1=m2+60-1-m1+s1
m2=m1%60
m1=m1/60
h2=h2-h1-1+m1
print('%d'%h2,'%d'%m2,'%d'%s2)
| true | true |
1c1775a670a92523f7619ac1759422e0809d8695 | 395 | py | Python | server.py | dipinoch/IRM_FPROJECT | 4b90dcec3d6caaf4764b160345a27006cd6e8e57 | [
"MIT"
] | null | null | null | server.py | dipinoch/IRM_FPROJECT | 4b90dcec3d6caaf4764b160345a27006cd6e8e57 | [
"MIT"
] | 3 | 2020-07-18T23:54:35.000Z | 2021-05-10T20:52:59.000Z | server.py | dipinoch/IRM_FPROJECT | 4b90dcec3d6caaf4764b160345a27006cd6e8e57 | [
"MIT"
] | null | null | null |
import sys
sys.path.append('/usr/local/lib')
import socket
import time
from imutils.video import VideoStream
from imagezmq import ImageSender
sender = ImageSender(connect_to='tcp://127.0.0.1:5555')
cam_name = socket.gethostname()
cam = VideoStream(src=0).start()
time.sleep(2.0)
while True: # send images as stream... | 26.333333 | 55 | 0.744304 |
import sys
sys.path.append('/usr/local/lib')
import socket
import time
from imutils.video import VideoStream
from imagezmq import ImageSender
sender = ImageSender(connect_to='tcp://127.0.0.1:5555')
cam_name = socket.gethostname()
cam = VideoStream(src=0).start()
time.sleep(2.0)
while True: image = cam.read()
... | true | true |
1c1775c248561456ec80b592a8f5b75459d7b2ad | 13,038 | py | Python | main.py | noddac/Crypto-Helper-Bot | 8b91ff9e9225c2847b04c9e17d852f6e3e5633a3 | [
"MIT"
] | 1 | 2021-07-06T04:19:25.000Z | 2021-07-06T04:19:25.000Z | main.py | noddac/Crypto-Helper-Bot | 8b91ff9e9225c2847b04c9e17d852f6e3e5633a3 | [
"MIT"
] | null | null | null | main.py | noddac/Crypto-Helper-Bot | 8b91ff9e9225c2847b04c9e17d852f6e3e5633a3 | [
"MIT"
] | 1 | 2021-04-20T09:11:10.000Z | 2021-04-20T09:11:10.000Z | import asyncio
import discord
import requests
import secrets
from bs4 import BeautifulSoup
from discord.ext import commands
print("Bot starts")
client = commands.Bot(command_prefix="?", help_command=None, intents=discord.Intents.all())
client.remove_command("help")
@client.event
async def on_ready():
print("Bo... | 46.070671 | 137 | 0.720049 | import asyncio
import discord
import requests
import secrets
from bs4 import BeautifulSoup
from discord.ext import commands
print("Bot starts")
client = commands.Bot(command_prefix="?", help_command=None, intents=discord.Intents.all())
client.remove_command("help")
@client.event
async def on_ready():
print("Bo... | true | true |
1c1776647f39eadebdea4abc70be0be4a86f5086 | 977 | py | Python | duple-api/duple/test/unit/test_datastore.py | HughZurname/duple | eed22c2525a32da3b4a429ebadaa950185aa6e66 | [
"MIT"
] | 1 | 2022-03-18T02:53:26.000Z | 2022-03-18T02:53:26.000Z | duple-api/duple/test/unit/test_datastore.py | HughZurname/duple | eed22c2525a32da3b4a429ebadaa950185aa6e66 | [
"MIT"
] | 1 | 2022-02-26T22:33:51.000Z | 2022-02-26T22:33:51.000Z | duple-api/duple/test/unit/test_datastore.py | HughZurname/duple | eed22c2525a32da3b4a429ebadaa950185aa6e66 | [
"MIT"
] | null | null | null | import pytest
from duple.datastore import (
DataStore,
get_datastore,
delete_datastore,
datastore_repository,
)
@pytest.fixture
def new_datastore():
return DataStore([], {})
@pytest.fixture
def existing_datastore():
return DataStore([], {"records": 10000}, 2, True, True, True, True)
@pyt... | 24.425 | 87 | 0.760491 | import pytest
from duple.datastore import (
DataStore,
get_datastore,
delete_datastore,
datastore_repository,
)
@pytest.fixture
def new_datastore():
return DataStore([], {})
@pytest.fixture
def existing_datastore():
return DataStore([], {"records": 10000}, 2, True, True, True, True)
@pyt... | true | true |
1c1776c02ca7bb8e10c6b573d3f94267c6da020e | 1,049 | py | Python | lib/aquilon/worker/commands/del_hostlink.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 7 | 2015-07-31T05:57:30.000Z | 2021-09-07T15:18:56.000Z | lib/aquilon/worker/commands/del_hostlink.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 115 | 2015-03-03T13:11:46.000Z | 2021-09-20T12:42:24.000Z | lib/aquilon/worker/commands/del_hostlink.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 13 | 2015-03-03T11:17:59.000Z | 2021-09-09T09:16:41.000Z | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | 37.464286 | 74 | 0.766444 |
from aquilon.aqdb.model import Hostlink
from aquilon.worker.broker import BrokerCommand from aquilon.worker.commands.del_resource import CommandDelResource
class CommandDelHostlink(CommandDelResource):
required_parameters = ["hostlink"]
resource_class = Hostlink
resource_name = "hostlink"
| true | true |
1c17772c2eef60fe3dd2e766afa3947ffaf4e533 | 5,600 | py | Python | models/rendering.py | sanowar-raihan/meta-neus | de58a303498423b674f0b03c4682b11e995c3064 | [
"MIT"
] | null | null | null | models/rendering.py | sanowar-raihan/meta-neus | de58a303498423b674f0b03c4682b11e995c3064 | [
"MIT"
] | null | null | null | models/rendering.py | sanowar-raihan/meta-neus | de58a303498423b674f0b03c4682b11e995c3064 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from models.networks import GeometryNet, AppearanceNet, SDensity
class NeuSRenderer(nn.Module):
"""
Neural Renderer according to NeuS
https://arxiv.org/abs/2106.10689
"""
def __init__(self,
geometry_net,
appearance_net,
... | 39.716312 | 111 | 0.555893 | import torch
import torch.nn as nn
from models.networks import GeometryNet, AppearanceNet, SDensity
class NeuSRenderer(nn.Module):
def __init__(self,
geometry_net,
appearance_net,
s_density,
num_samples,
perturb,
... | true | true |
1c1778729602fbf8563262c9c485daf536532513 | 722 | py | Python | apps/staff/views.py | mehrbodjavadi79/AIC21-Backend | 9f4342781f0722804a2eb704b43b52984c81b40a | [
"MIT"
] | 3 | 2021-03-12T18:32:39.000Z | 2021-11-08T10:21:04.000Z | apps/staff/views.py | mehrbodjavadi79/AIC21-Backend | 9f4342781f0722804a2eb704b43b52984c81b40a | [
"MIT"
] | null | null | null | apps/staff/views.py | mehrbodjavadi79/AIC21-Backend | 9f4342781f0722804a2eb704b43b52984c81b40a | [
"MIT"
] | 2 | 2021-01-29T14:52:53.000Z | 2022-03-05T10:24:24.000Z | import json
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.generics import GenericAPIView
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from apps.staff.services.staffs_list... | 28.88 | 75 | 0.815789 | import json
from django.http import JsonResponse
from django.shortcuts import get_object_or_404
from rest_framework import status
from rest_framework.generics import GenericAPIView
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from apps.staff.services.staffs_list... | true | true |
1c17795efb6cc2816afc456bf5299ac4b1b12e96 | 2,025 | py | Python | src/python/services/api/config.py | benlague/CS411 | afff0affb0a353c4fd14b6229dd83ef5ab7520aa | [
"MIT"
] | null | null | null | src/python/services/api/config.py | benlague/CS411 | afff0affb0a353c4fd14b6229dd83ef5ab7520aa | [
"MIT"
] | null | null | null | src/python/services/api/config.py | benlague/CS411 | afff0affb0a353c4fd14b6229dd83ef5ab7520aa | [
"MIT"
] | null | null | null | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
DEBUG = False
TESTING = False
SECRET_KEY = os.environ.get('SECRET_KEY', '123')
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY', '123')
YELP_API_KEY = os.environ.get('YELP_API_KEY')
BESTTIME_API_KEY = os.environ.get(... | 29.779412 | 97 | 0.683457 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
DEBUG = False
TESTING = False
SECRET_KEY = os.environ.get('SECRET_KEY', '123')
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY', '123')
YELP_API_KEY = os.environ.get('YELP_API_KEY')
BESTTIME_API_KEY = os.environ.get(... | true | true |
1c177a25ea6afbea2da0b49aa8e3cc350f982938 | 3,963 | py | Python | mmpm/models.py | Spyna/mmpm | ec92f9cc654e17b23b38bcc371283c161b680a0c | [
"MIT"
] | 106 | 2019-06-27T05:15:50.000Z | 2022-03-25T03:37:08.000Z | mmpm/models.py | Spyna/mmpm | ec92f9cc654e17b23b38bcc371283c161b680a0c | [
"MIT"
] | 90 | 2019-05-21T06:38:35.000Z | 2022-03-18T13:27:09.000Z | mmpm/models.py | GovindRaju11/mmpm | 41262fac7b2be3cc3fce9a43c3b64aa411072975 | [
"MIT"
] | 24 | 2020-01-17T19:52:38.000Z | 2022-02-13T21:00:57.000Z | #!/usr/bin/env python3
import os
import logging
import logging.handlers
import mmpm.consts
NA: str = mmpm.consts.NOT_AVAILABLE
class MMPMLogger():
'''
Object used for logging while MMPM is executing.
Log files can be found in ~/.config/mmpm/log
'''
def __init__(self):
self.log_file: str ... | 32.219512 | 142 | 0.625032 | import os
import logging
import logging.handlers
import mmpm.consts
NA: str = mmpm.consts.NOT_AVAILABLE
class MMPMLogger():
def __init__(self):
self.log_file: str = mmpm.consts.MMPM_CLI_LOG_FILE
if not os.path.exists(mmpm.consts.MMPM_LOG_DIR):
os.system(f'mkdir -p {mmpm.consts.MMPM_... | true | true |
1c177a69e916dcebdd43049132a3dde78ba55b62 | 1,327 | py | Python | PyFlow/Packages/PyFlowBase/Tools/AlignLeftTool.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 1,463 | 2019-07-29T15:45:22.000Z | 2022-03-31T23:32:13.000Z | PyFlow/Packages/PyFlowBase/Tools/AlignLeftTool.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 58 | 2019-07-31T07:58:57.000Z | 2022-02-23T05:46:08.000Z | PyFlow/Packages/PyFlowBase/Tools/AlignLeftTool.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 169 | 2019-08-03T16:38:57.000Z | 2022-03-31T14:20:12.000Z | ## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera
## 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... | 30.159091 | 75 | 0.732479 |
from nine import str
from PyFlow.UI.Tool.Tool import ShelfTool
from PyFlow.Packages.PyFlowBase.Tools import RESOURCES_DIR
from PyFlow.Core.Common import Direction
from Qt import QtGui
from Qt.QtWidgets import QFileDialog
class AlignLeftTool(ShelfTool):
def __init__(self):
super(AlignLeftTool, self).... | true | true |
1c177b191ac74d70a93a8faafd98a7bd965a4cd2 | 2,667 | py | Python | edna2/utils/test/UtilsTest_unit_test.py | gsantoni/edna2 | 0aad63a3ea8091ce62118f0b2c8ac78a2286da9e | [
"CC0-1.0",
"MIT"
] | null | null | null | edna2/utils/test/UtilsTest_unit_test.py | gsantoni/edna2 | 0aad63a3ea8091ce62118f0b2c8ac78a2286da9e | [
"CC0-1.0",
"MIT"
] | 2 | 2020-04-06T10:39:50.000Z | 2021-04-14T19:24:37.000Z | edna2/utils/test/UtilsTest_unit_test.py | gsantoni/edna2 | 0aad63a3ea8091ce62118f0b2c8ac78a2286da9e | [
"CC0-1.0",
"MIT"
] | 5 | 2019-06-14T07:28:38.000Z | 2021-04-28T13:10:39.000Z | #
# Copyright (c) European Synchrotron Radiation Facility (ESRF)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy,... | 42.333333 | 99 | 0.718035 |
__authors__ = ["O. Svensson"]
__license__ = "MIT"
__date__ = "21/04/2019"
import unittest
from edna2.utils import UtilsTest
class UtilsTestUnitTest(unittest.TestCase):
def setUp(self):
self.inData1 = {
"image": "$EDNA2_TESTDATA_IMAGES/ref-2m_RNASE_1_0001.cbf"
}
self.inData... | true | true |
1c177b7a4507485ee444b9a0e432428b70c30aec | 1,596 | py | Python | setup.py | gazconroy/redoc | fbde75553c2cc9add37c60b63e2ef9ec757cda7c | [
"BSD-2-Clause"
] | 16 | 2019-09-29T02:07:28.000Z | 2021-11-04T12:53:33.000Z | setup.py | gazconroy/redoc | fbde75553c2cc9add37c60b63e2ef9ec757cda7c | [
"BSD-2-Clause"
] | 20 | 2017-04-08T14:22:50.000Z | 2019-06-08T17:27:42.000Z | setup.py | gazconroy/redoc | fbde75553c2cc9add37c60b63e2ef9ec757cda7c | [
"BSD-2-Clause"
] | 18 | 2019-06-11T02:56:04.000Z | 2022-02-05T00:34:32.000Z | import os
from io import open
from setuptools import setup, find_packages
here = os.path.dirname(__file__)
with open(os.path.join(here, 'README.rst'), 'r', encoding='utf-8') as f:
long_description = f.read()
setup(
name='sphinxcontrib-redoc',
description='ReDoc powered OpenAPI (fka Swagger) spec rende... | 30.113208 | 79 | 0.615915 | import os
from io import open
from setuptools import setup, find_packages
here = os.path.dirname(__file__)
with open(os.path.join(here, 'README.rst'), 'r', encoding='utf-8') as f:
long_description = f.read()
setup(
name='sphinxcontrib-redoc',
description='ReDoc powered OpenAPI (fka Swagger) spec rende... | true | true |
1c177bd6d6f0edd681674ceb175c40c1509d919b | 11,608 | py | Python | scipy/stats/tests/test_discrete_basic.py | boeleman/scipy | e8212863a7c09e047e78a9a8f983527ad01c69fc | [
"BSD-3-Clause"
] | null | null | null | scipy/stats/tests/test_discrete_basic.py | boeleman/scipy | e8212863a7c09e047e78a9a8f983527ad01c69fc | [
"BSD-3-Clause"
] | null | null | null | scipy/stats/tests/test_discrete_basic.py | boeleman/scipy | e8212863a7c09e047e78a9a8f983527ad01c69fc | [
"BSD-3-Clause"
] | null | null | null | import numpy.testing as npt
import numpy as np
import pytest
from scipy import stats
from .common_tests import (check_normalization, check_moment, check_mean_expect,
check_var_expect, check_skew_expect,
check_kurt_expect, check_entropy,
c... | 36.049689 | 80 | 0.62052 | import numpy.testing as npt
import numpy as np
import pytest
from scipy import stats
from .common_tests import (check_normalization, check_moment, check_mean_expect,
check_var_expect, check_skew_expect,
check_kurt_expect, check_entropy,
c... | true | true |
1c177d125d3ac823cc00f2d4460766b6f803caf6 | 516 | py | Python | string_kernel/core/src/setup.py | fdtomasi/string_kernel | 4685b87ff5ce2ccec0270a1faaf62df40a93232e | [
"MIT"
] | 1 | 2017-11-04T05:26:14.000Z | 2017-11-04T05:26:14.000Z | string_kernel/core/src/setup.py | fdtomasi/string_kernel | 4685b87ff5ce2ccec0270a1faaf62df40a93232e | [
"MIT"
] | null | null | null | string_kernel/core/src/setup.py | fdtomasi/string_kernel | 4685b87ff5ce2ccec0270a1faaf62df40a93232e | [
"MIT"
] | 1 | 2017-11-16T21:57:22.000Z | 2017-11-16T21:57:22.000Z | """setup.py for alignment module.
Author: Federico Tomasi
Copyright (c) 2016, Federico Tomasi.
Licensed under the FreeBSD license (see LICENSE.txt).
"""
from distutils.core import setup, Extension
module1 = Extension('string_kernel',
sources=['string_kernel.cpp'])
module2 = Extension('sum_string_... | 27.157895 | 54 | 0.678295 | from distutils.core import setup, Extension
module1 = Extension('string_kernel',
sources=['string_kernel.cpp'])
module2 = Extension('sum_string_kernel',
sources=['sum_string_kernel.cpp'])
setup(name='string_kernel',
version='1.0',
description='This is a demo packag... | true | true |
1c177e4828e4745002c0aea270b9987293a251fe | 1,405 | py | Python | util/experiment.py | eth-sri/3dcertify | bb10f339f80149a9ebc7c07d041b2ef222efb394 | [
"Apache-2.0"
] | 9 | 2021-03-31T20:27:50.000Z | 2022-01-07T21:52:47.000Z | util/experiment.py | eth-sri/3dcertify | bb10f339f80149a9ebc7c07d041b2ef222efb394 | [
"Apache-2.0"
] | 2 | 2021-06-21T15:38:07.000Z | 2021-11-08T09:10:09.000Z | util/experiment.py | eth-sri/3dcertify | bb10f339f80149a9ebc7c07d041b2ef222efb394 | [
"Apache-2.0"
] | 4 | 2021-07-17T15:04:14.000Z | 2022-02-09T17:51:39.000Z | import json
from argparse import Namespace
from pathlib import Path
from util import logging
from util.math import set_random_seed
class Experiment:
__OUTPUT_PATH = 'out/certification'
def __init__(self, settings: Namespace):
self.settings = settings
self.experiment_directory = self.__setup_... | 36.025641 | 86 | 0.706762 | import json
from argparse import Namespace
from pathlib import Path
from util import logging
from util.math import set_random_seed
class Experiment:
__OUTPUT_PATH = 'out/certification'
def __init__(self, settings: Namespace):
self.settings = settings
self.experiment_directory = self.__setup_... | true | true |
1c177f7bc9393d9cbd529eabad286c4b3eae9026 | 814 | py | Python | hawk_eye/inference/benchmark_inference_test.py | uavaustin/image-rec | befb2a171397775e3282284aa636993488ff6ebc | [
"MIT"
] | null | null | null | hawk_eye/inference/benchmark_inference_test.py | uavaustin/image-rec | befb2a171397775e3282284aa636993488ff6ebc | [
"MIT"
] | 11 | 2020-06-07T16:07:52.000Z | 2022-01-13T03:33:16.000Z | hawk_eye/inference/benchmark_inference_test.py | uavaustin/hawk-eye | befb2a171397775e3282284aa636993488ff6ebc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Simple test to ensure inference benchmarking function works."""
import unittest
from hawk_eye.inference import benchmark_inference
from hawk_eye.inference import production_models
class BenchmarkInference(unittest.TestCase):
def test_classifier(self) -> None:
benchmark_inferen... | 26.258065 | 79 | 0.659705 |
import unittest
from hawk_eye.inference import benchmark_inference
from hawk_eye.inference import production_models
class BenchmarkInference(unittest.TestCase):
def test_classifier(self) -> None:
benchmark_inference.benchmark(
timestamp=production_models.PROD_MODELS["classifier"]["timestamp... | true | true |
1c177f97ccb9f2c48f51649af8194726d0b9e7cd | 1,562 | py | Python | authentication/views.py | dogancankilment/utopian-io-reddit | cd3269d45d1ca56de6a3e9ae95b14af9b39dc5b1 | [
"Apache-2.0"
] | null | null | null | authentication/views.py | dogancankilment/utopian-io-reddit | cd3269d45d1ca56de6a3e9ae95b14af9b39dc5b1 | [
"Apache-2.0"
] | null | null | null | authentication/views.py | dogancankilment/utopian-io-reddit | cd3269d45d1ca56de6a3e9ae95b14af9b39dc5b1 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import redirect, render, render_to_response
from django.contrib import auth
from django.contrib.auth import authenticate
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import r... | 27.403509 | 77 | 0.679898 | from django.shortcuts import redirect, render, render_to_response
from django.contrib import auth
from django.contrib.auth import authenticate
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import r... | true | true |
1c177fe91da58637c53fe47b785a2b7126daf2d3 | 8,785 | py | Python | report/helper.py | Memorydemoeric/syc | 6ae424654fa2a53051a4d411b7623eedc320d569 | [
"MIT"
] | null | null | null | report/helper.py | Memorydemoeric/syc | 6ae424654fa2a53051a4d411b7623eedc320d569 | [
"MIT"
] | 1 | 2021-05-13T07:35:51.000Z | 2021-05-13T07:35:51.000Z | report/helper.py | Memorydemoeric/syc | 6ae424654fa2a53051a4d411b7623eedc320d569 | [
"MIT"
] | null | null | null | import datetime
from purchase.models import Purchase
from report.models import CashFlow, CustomerRank, StatementOutputDetail
from storage.models import StorageOut, ProductInfo, StorageOutDetail
class FinalStatementOutputData(object):
def __init__(self, create_date, origin_balance, income, total_actual_price, re... | 44.145729 | 119 | 0.644394 | import datetime
from purchase.models import Purchase
from report.models import CashFlow, CustomerRank, StatementOutputDetail
from storage.models import StorageOut, ProductInfo, StorageOutDetail
class FinalStatementOutputData(object):
def __init__(self, create_date, origin_balance, income, total_actual_price, re... | true | true |
1c178001f57ae1815ef30abebf3cc04ef284e96b | 15,769 | py | Python | detectron2/engine/defaults.py | suoluowan/AMANet-pytorch | 9981447a284bde8e76744928f0feba34f2a5cd6f | [
"Apache-2.0"
] | 3 | 2021-02-02T23:22:35.000Z | 2021-02-03T13:43:51.000Z | detectron2/engine/defaults.py | suoluowan/AMANet-pytorch | 9981447a284bde8e76744928f0feba34f2a5cd6f | [
"Apache-2.0"
] | 1 | 2022-01-17T10:51:39.000Z | 2022-01-17T10:51:39.000Z | detectron2/engine/defaults.py | suoluowan/AMANet-pytorch | 9981447a284bde8e76744928f0feba34f2a5cd6f | [
"Apache-2.0"
] | 2 | 2022-01-05T02:13:53.000Z | 2022-01-19T07:49:29.000Z | # -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
This file contains components with some default boilerplate logic user may need
in training / testing. They will not work for everyone, but many users may find them useful.
The behavior of functions/classes in this file... | 36.843458 | 203 | 0.646205 |
import argparse
import logging
import os
from collections import OrderedDict
import torch
from fvcore.common.file_io import PathManager
from fvcore.nn.precise_bn import get_bn_modules
from torch.nn.parallel import DistributedDataParallel
import detectron2.data.transforms as T
from detectron2.checkpoint import Detect... | true | true |
1c17827a6f436d373f508d7ed58c24717cc9c7da | 7,154 | py | Python | ui_game_dialog.py | michael-lazar/playscii | 2416e7438b993abd119a86b0fc1ffb1170eb33c3 | [
"MIT"
] | 14 | 2020-04-08T22:52:59.000Z | 2022-03-21T03:13:41.000Z | ui_game_dialog.py | michael-lazar/playscii | 2416e7438b993abd119a86b0fc1ffb1170eb33c3 | [
"MIT"
] | 2 | 2021-09-21T12:04:21.000Z | 2021-09-21T13:42:47.000Z | ui_game_dialog.py | squintdev/nftscii | dcefdd1deef9bdb3517c39d0129e948d238d4978 | [
"MIT"
] | 2 | 2021-11-16T03:30:59.000Z | 2021-12-23T18:29:54.000Z |
from ui_dialog import UIDialog, Field
from ui_console import SetGameDirCommand, LoadGameStateCommand, SaveGameStateCommand
from ui_list_operations import LO_NONE, LO_SELECT_OBJECTS, LO_SET_SPAWN_CLASS, LO_LOAD_STATE, LO_SET_ROOM, LO_SET_ROOM_OBJECTS, LO_SET_OBJECT_ROOMS, LO_OPEN_GAME_DIR, LO_SET_ROOM_EDGE_WARP
clas... | 35.949749 | 188 | 0.682695 |
from ui_dialog import UIDialog, Field
from ui_console import SetGameDirCommand, LoadGameStateCommand, SaveGameStateCommand
from ui_list_operations import LO_NONE, LO_SELECT_OBJECTS, LO_SET_SPAWN_CLASS, LO_LOAD_STATE, LO_SET_ROOM, LO_SET_ROOM_OBJECTS, LO_SET_OBJECT_ROOMS, LO_OPEN_GAME_DIR, LO_SET_ROOM_EDGE_WARP
clas... | true | true |
1c17828a3ad649b4da34ef2ef39bbb76fceab017 | 6,244 | py | Python | gmshparser/mesh.py | ahojukka5/gmshparser | add27f8ddc97fb14614432e02bc626ec61030b6d | [
"MIT"
] | 10 | 2020-04-17T21:02:07.000Z | 2021-12-21T23:11:34.000Z | gmshparser/mesh.py | ahojukka5/gmshparser | add27f8ddc97fb14614432e02bc626ec61030b6d | [
"MIT"
] | null | null | null | gmshparser/mesh.py | ahojukka5/gmshparser | add27f8ddc97fb14614432e02bc626ec61030b6d | [
"MIT"
] | 1 | 2020-11-18T18:04:48.000Z | 2020-11-18T18:04:48.000Z | from typing import List
from gmshparser.node_entity import NodeEntity
from gmshparser.element_entity import ElementEntity
from io import StringIO
class Mesh(object):
"""Mesh is the main class of the package."""
def __init__(self):
self.name_ = "New Mesh"
self.version_ = "4.1"
self.as... | 35.885057 | 79 | 0.64574 | from typing import List
from gmshparser.node_entity import NodeEntity
from gmshparser.element_entity import ElementEntity
from io import StringIO
class Mesh(object):
def __init__(self):
self.name_ = "New Mesh"
self.version_ = "4.1"
self.ascii_ = True
self.precision_ = 8 ... | true | true |
1c1783a5b72a9601ec744da4d497d9d4ed6b27f7 | 13,532 | py | Python | tests/wallet/rpc/test_wallet_rpc.py | zcomputerwiz/chivesv2-blockchain | f36235e16a348f7fe3e7f9cdbc92615f391a877b | [
"Apache-2.0"
] | null | null | null | tests/wallet/rpc/test_wallet_rpc.py | zcomputerwiz/chivesv2-blockchain | f36235e16a348f7fe3e7f9cdbc92615f391a877b | [
"Apache-2.0"
] | null | null | null | tests/wallet/rpc/test_wallet_rpc.py | zcomputerwiz/chivesv2-blockchain | f36235e16a348f7fe3e7f9cdbc92615f391a877b | [
"Apache-2.0"
] | null | null | null | import asyncio
from chives.util.config import load_config, save_config
import logging
from pathlib import Path
import pytest
from chives.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from chives.rpc.full_node_rpc_api import FullNodeRpcApi
from chives.rpc.full_node_rpc_client impor... | 43.233227 | 119 | 0.642477 | import asyncio
from chives.util.config import load_config, save_config
import logging
from pathlib import Path
import pytest
from chives.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from chives.rpc.full_node_rpc_api import FullNodeRpcApi
from chives.rpc.full_node_rpc_client impor... | true | true |
1c1783bef1b49c6b2ece1ad11a1950f3187e26ef | 26,455 | py | Python | evennia/server/server.py | frnknstn/evennia | db637941af2e6c697ef745bb4d8e6ecbee97a727 | [
"BSD-3-Clause"
] | 127 | 2015-04-16T15:27:59.000Z | 2022-03-10T08:35:37.000Z | evennia/server/server.py | frnknstn/evennia | db637941af2e6c697ef745bb4d8e6ecbee97a727 | [
"BSD-3-Clause"
] | 14 | 2015-12-17T08:02:18.000Z | 2022-01-30T15:15:38.000Z | evennia/server/server.py | frnknstn/evennia | db637941af2e6c697ef745bb4d8e6ecbee97a727 | [
"BSD-3-Clause"
] | 54 | 2015-06-23T07:27:45.000Z | 2022-02-22T01:46:05.000Z | """
This module implements the main Evennia server process, the core of
the game engine.
This module should be started with the 'twistd' executable since it
sets up all the networking features. (this is done automatically
by evennia/server/server_runner.py).
"""
import time
import sys
import os
from twisted.web imp... | 36.590595 | 99 | 0.638102 | import time
import sys
import os
from twisted.web import static
from twisted.application import internet, service
from twisted.internet import reactor, defer
from twisted.internet.task import LoopingCall
from twisted.python.log import ILogObserver
import django
django.setup()
import evennia
evennia._init()
from d... | true | true |
1c1783f89ef63a4e33b08c76efb041727f41c8df | 18,044 | py | Python | qa/rpc-tests/test_framework/comptool.py | BitcoinFlash/BitcoinFlash | ce9afff8bb6d37eec74ad9050f25e104a0037c4c | [
"MIT"
] | 3 | 2017-12-29T00:29:23.000Z | 2018-01-02T03:46:50.000Z | qa/rpc-tests/test_framework/comptool.py | BitcoinFlash/BitcoinFlash | ce9afff8bb6d37eec74ad9050f25e104a0037c4c | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/comptool.py | BitcoinFlash/BitcoinFlash | ce9afff8bb6d37eec74ad9050f25e104a0037c4c | [
"MIT"
] | 5 | 2018-01-14T02:59:10.000Z | 2022-03-15T14:30:38.000Z | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from .mininode import *
from .blockstore import BlockStore, TxStore
from .util import p2p_port
'''
This is a tool for comparing two or more bitcoinfla... | 44.774194 | 145 | 0.603303 |
from .mininode import *
from .blockstore import BlockStore, TxStore
from .util import p2p_port
'''
This is a tool for comparing two or more bitcoinflashds to each other
using a script provided.
To use, create a class that implements get_tests(), and pass it in
as the test generator to TestManager. get_tests() shoul... | false | true |
1c178501edb73c4dc0c9076e87bfbf279ced57a1 | 160 | py | Python | vestlus/forms/channel.py | lehvitus/vestlus | 6d9c8b1de7821e544e0c7c99f42d60f8f3805557 | [
"BSD-3-Clause"
] | 12 | 2020-07-02T23:36:02.000Z | 2020-12-15T07:29:20.000Z | vestlus/forms/channel.py | lehvitus/vestlus | 6d9c8b1de7821e544e0c7c99f42d60f8f3805557 | [
"BSD-3-Clause"
] | null | null | null | vestlus/forms/channel.py | lehvitus/vestlus | 6d9c8b1de7821e544e0c7c99f42d60f8f3805557 | [
"BSD-3-Clause"
] | null | null | null | from django.forms import forms
from ..models import Channel
class ChannelForm(forms.Form):
class Meta:
model = Channel
fields = '__all__'
| 17.777778 | 30 | 0.675 | from django.forms import forms
from ..models import Channel
class ChannelForm(forms.Form):
class Meta:
model = Channel
fields = '__all__'
| true | true |
1c1785080c0c3b847e8a2de7b7210229cc9d382d | 3,374 | py | Python | pond_spill/plotpoints.py | joanna-chen/schoolwork | 86a99511f5d8f21cac4bfd9f8da51590324cf339 | [
"MIT"
] | null | null | null | pond_spill/plotpoints.py | joanna-chen/schoolwork | 86a99511f5d8f21cac4bfd9f8da51590324cf339 | [
"MIT"
] | null | null | null | pond_spill/plotpoints.py | joanna-chen/schoolwork | 86a99511f5d8f21cac4bfd9f8da51590324cf339 | [
"MIT"
] | null | null | null |
#
# Plot points in simple graph
#
from graphics import GraphicsWindow
from math import sin
from math import cos
#
# creates a grid on a canvas for drawing points
#
def createGrid(canvas,maxx,maxy):
# Draw the coordinate system; but invert graph so that plot starts in lower left.
# - assumes a 5... | 33.078431 | 94 | 0.635151 |
from graphics import GraphicsWindow
from math import sin
from math import cos
def createGrid(canvas,maxx,maxy):
half = 5
canvas.drawLine(50, 50, 450, 50)
canvas.drawLine(50, 50, 50, 450)
canvas.drawLine(450,50,450,450)
canvas.drawLine(50,450,450,450)
... | true | true |
1c178508da66ac484a51ef36562eb86f692e8075 | 1,468 | py | Python | examples/cutensor/elementwise_trinary.py | Dahlia-Chehata/cupy | 1005f55075f89aa17e60074aaa6494ff8d033251 | [
"MIT"
] | null | null | null | examples/cutensor/elementwise_trinary.py | Dahlia-Chehata/cupy | 1005f55075f89aa17e60074aaa6494ff8d033251 | [
"MIT"
] | null | null | null | examples/cutensor/elementwise_trinary.py | Dahlia-Chehata/cupy | 1005f55075f89aa17e60074aaa6494ff8d033251 | [
"MIT"
] | null | null | null | #
# D_{x,y,z} = alpha * A_{z,y,x} + beta * B_{y,z,x} + gamma * C_{x,y,z}
#
import numpy
import cupy
from cupy import cutensor
import cupyx.time
dtype = numpy.float32
mode_a = ('z', 'y', 'x')
mode_b = ('y', 'z', 'x')
mode_c = ('x', 'y', 'z')
extent = {'x': 400, 'y': 200, 'z': 300}
a = cupy.random.random([extent[i] ... | 25.754386 | 70 | 0.673706 | import numpy
import cupy
from cupy import cutensor
import cupyx.time
dtype = numpy.float32
mode_a = ('z', 'y', 'x')
mode_b = ('y', 'z', 'x')
mode_c = ('x', 'y', 'z')
extent = {'x': 400, 'y': 200, 'z': 300}
a = cupy.random.random([extent[i] for i in mode_a])
b = cupy.random.random([extent[i] for i in mode_b])
c = c... | true | true |
1c178854d35b07d968a9e267c537246893c8ade2 | 6,110 | py | Python | gather_tweets.py | Cinkupis/chasing-arguments | fe47793a477d26b878489aabb80edccf2d253c61 | [
"MIT"
] | null | null | null | gather_tweets.py | Cinkupis/chasing-arguments | fe47793a477d26b878489aabb80edccf2d253c61 | [
"MIT"
] | null | null | null | gather_tweets.py | Cinkupis/chasing-arguments | fe47793a477d26b878489aabb80edccf2d253c61 | [
"MIT"
] | null | null | null | import key_secret
import tweepy
import csv
import os
import re
from re import finditer
from nltk.corpus import stopwords
from nltk.corpus import wordnet as wn
from nltk.stem.wordnet import WordNetLemmatizer
from nltk import pos_tag
class TwitterMining:
def __init__(self):
self.__tweets_csv_path = os.getc... | 42.727273 | 113 | 0.514894 | import key_secret
import tweepy
import csv
import os
import re
from re import finditer
from nltk.corpus import stopwords
from nltk.corpus import wordnet as wn
from nltk.stem.wordnet import WordNetLemmatizer
from nltk import pos_tag
class TwitterMining:
def __init__(self):
self.__tweets_csv_path = os.getc... | true | true |
1c178860da18449cb053ed13e196612e10a08573 | 180 | py | Python | espnet/__init__.py | tvuong123/espnet | 24aa0296bc480d7b32250d71b988bb9c8fdc4466 | [
"Apache-2.0"
] | 33 | 2020-11-03T12:39:24.000Z | 2022-02-05T15:00:21.000Z | espnet/__init__.py | tvuong123/espnet | 24aa0296bc480d7b32250d71b988bb9c8fdc4466 | [
"Apache-2.0"
] | 2 | 2021-02-24T06:20:53.000Z | 2021-05-19T16:52:11.000Z | espnet/__init__.py | tvuong123/espnet | 24aa0296bc480d7b32250d71b988bb9c8fdc4466 | [
"Apache-2.0"
] | 5 | 2019-07-19T16:40:57.000Z | 2020-11-05T20:09:44.000Z | import pkg_resources
try:
__version__ = pkg_resources.get_distribution('espnet').version
except Exception:
__version__ = '(Not installed from setup.py)'
del pkg_resources
| 22.5 | 66 | 0.777778 | import pkg_resources
try:
__version__ = pkg_resources.get_distribution('espnet').version
except Exception:
__version__ = '(Not installed from setup.py)'
del pkg_resources
| true | true |
1c1788cd2ec9336fa0ad59f4ae580efeb0300c54 | 2,207 | py | Python | codes/test.py | fancyicookie/HDRUNet | 95c018408752caceeed37b756fd51c9f465a53ff | [
"MIT"
] | 90 | 2021-04-13T04:56:19.000Z | 2022-03-26T18:47:15.000Z | codes/test.py | fancyicookie/HDRUNet | 95c018408752caceeed37b756fd51c9f465a53ff | [
"MIT"
] | 18 | 2021-06-01T07:00:17.000Z | 2022-03-18T02:04:22.000Z | codes/test.py | fancyicookie/HDRUNet | 95c018408752caceeed37b756fd51c9f465a53ff | [
"MIT"
] | 15 | 2021-05-28T02:12:30.000Z | 2022-03-24T02:48:01.000Z | import os.path as osp
import logging
import time
import argparse
from collections import OrderedDict
import options.options as option
import utils.util as util
from data import create_dataset, create_dataloader
from models import create_model
import numpy as np
#### options
parser = argparse.ArgumentParser()
parser.... | 36.783333 | 99 | 0.711373 | import os.path as osp
import logging
import time
import argparse
from collections import OrderedDict
import options.options as option
import utils.util as util
from data import create_dataset, create_dataloader
from models import create_model
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument(... | true | true |
1c178a95f750ffda0e37c0f4853178688647e7ff | 9,665 | py | Python | Lib/unittest/test/test_skipping.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 2,441 | 2020-07-31T06:45:53.000Z | 2022-03-30T15:56:49.000Z | Lib/unittest/test/test_skipping.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 387 | 2020-12-15T14:54:04.000Z | 2022-03-31T07:00:21.000Z | Lib/unittest/test/test_skipping.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 93 | 2020-08-09T12:00:17.000Z | 2022-03-25T07:57:24.000Z | import unittest
from unittest.test.support import LoggingResult
class Test_TestSkipping(unittest.TestCase):
def test_skipping(self):
class Foo(unittest.TestCase):
def test_skip_me(self):
self.skipTest("skip")
events = []
result = LoggingResult(events)
... | 35.533088 | 75 | 0.559131 | import unittest
from unittest.test.support import LoggingResult
class Test_TestSkipping(unittest.TestCase):
def test_skipping(self):
class Foo(unittest.TestCase):
def test_skip_me(self):
self.skipTest("skip")
events = []
result = LoggingResult(events)
... | true | true |
1c178ad77de95a37720548570f360bbee7615eca | 62,778 | py | Python | deepNormalize/training/dcgan.py | sami-ets/DeepNormalize | 5ed53280d98a201d45bb9973e79736136273eaea | [
"MIT"
] | 1 | 2020-05-21T20:52:48.000Z | 2020-05-21T20:52:48.000Z | deepNormalize/training/dcgan.py | sami-ets/DeepNormalize | 5ed53280d98a201d45bb9973e79736136273eaea | [
"MIT"
] | null | null | null | deepNormalize/training/dcgan.py | sami-ets/DeepNormalize | 5ed53280d98a201d45bb9973e79736136273eaea | [
"MIT"
] | 1 | 2020-05-21T20:52:54.000Z | 2020-05-21T20:52:54.000Z | # -*- coding: utf-8 -*-
# Copyright 2019 Pierre-Luc Delisle. All Rights Reserved.
#
# Licensed under the MIT License;
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed t... | 59.057385 | 262 | 0.619325 | import time
from datetime import timedelta
from typing import List
import cv2
import numpy as np
import os
import pynvml
import torch
from ignite.metrics.confusion_matrix import ConfusionMatrix
from kerosene.configs.configs import RunConfiguration
from kerosene.metrics.gauges import AverageGauge
from kerosene.nn.funct... | true | true |
1c178d7d74fd97e4c8f9e7a07275be859a0a541a | 6,419 | py | Python | simulation_control/src/scripts/position_control.py | AndersBogga/F651_Brute | 1aac55b863293ba84d6534bf6f3ef5374dca44da | [
"Apache-2.0"
] | null | null | null | simulation_control/src/scripts/position_control.py | AndersBogga/F651_Brute | 1aac55b863293ba84d6534bf6f3ef5374dca44da | [
"Apache-2.0"
] | null | null | null | simulation_control/src/scripts/position_control.py | AndersBogga/F651_Brute | 1aac55b863293ba84d6534bf6f3ef5374dca44da | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from geometry_msgs.msg import PoseStamped, TwistStamped, Point
import rospy
import math
from std_msgs.msg import Float32, Bool, String
from VelocityController import VelocityController
import numpy as np
class position_control():
def __init__(self):
print 'Initialising position contro... | 42.509934 | 145 | 0.669107 | from geometry_msgs.msg import PoseStamped, TwistStamped, Point
import rospy
import math
from std_msgs.msg import Float32, Bool, String
from VelocityController import VelocityController
import numpy as np
class position_control():
def __init__(self):
print 'Initialising position control'
rospy.init_... | false | true |
1c178e7f4d67db9c15d237ad6338a1aff98d2381 | 402 | py | Python | main/links/migrations/0002_auto_20161106_0137.py | TunedMystic/url-shortener | 6a6abc8ee2397c3d4626189fbc362232a60ddef2 | [
"MIT"
] | null | null | null | main/links/migrations/0002_auto_20161106_0137.py | TunedMystic/url-shortener | 6a6abc8ee2397c3d4626189fbc362232a60ddef2 | [
"MIT"
] | null | null | null | main/links/migrations/0002_auto_20161106_0137.py | TunedMystic/url-shortener | 6a6abc8ee2397c3d4626189fbc362232a60ddef2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-06 01:37
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('links', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... | 20.1 | 50 | 0.599502 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('links', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='link',
options={'ordering': ('created_on',)},
... | true | true |
1c178ec4a67c6a6795e890fbf9790d46d3f9dbcc | 708 | py | Python | Fibonacci_ord.py | SomanathanSubramaniyan/Programming-and-Scripting | cdebccb32b39e0b4f168bcb8afbb14a024b308c7 | [
"Apache-2.0"
] | null | null | null | Fibonacci_ord.py | SomanathanSubramaniyan/Programming-and-Scripting | cdebccb32b39e0b4f168bcb8afbb14a024b308c7 | [
"Apache-2.0"
] | null | null | null | Fibonacci_ord.py | SomanathanSubramaniyan/Programming-and-Scripting | cdebccb32b39e0b4f168bcb8afbb14a024b308c7 | [
"Apache-2.0"
] | null | null | null | # Somu 22-01-2018
# Execution of Ian McLoughlin 's Source code
# A program that displays Fibonacci numbers.
def fib(n):
"""This function returns the nth Fibonacci number."""
i = 0
j = 1
n = n - 1
while n >= 0:
i, j = j, i + j
n = n - 1
return i
# My Surname is Subramaniyan.
# The First and Las... | 22.125 | 100 | 0.662429 | # A program that displays Fibonacci numbers.
def fib(n):
i = 0
j = 1
n = n - 1
while n >= 0:
i, j = j, i + j
n = n - 1
return i
# My Surname is Subramaniyan.
# The First and Last character digits are summed up. Fibonacci numbers are displayed for that number
name = "Subramaniyan"
first = name[0]
... | true | true |
1c178f5284812e0c47a121d98a4a7e0ec86e12f2 | 874 | py | Python | azure-mgmt-logic/azure/mgmt/logic/models/workflow_paged.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure/mgmt/logic/models/workflow_paged.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure/mgmt/logic/models/workflow_paged.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 31.214286 | 76 | 0.557208 |
from msrest.paging import Paged
class WorkflowPaged(Paged):
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[Workflow]'}
}
def __init__(self, *args, **kwargs):
super(WorkflowPaged, self).__init__(*args, **kwargs)
| true | true |
1c179067524cf462e379e1eadc314ebad2223684 | 211 | py | Python | glrestore/version.py | MrOlm/glrestore | 60d0140135b7b290aec73a92ab40bafaa4f00ece | [
"MIT"
] | 1 | 2022-03-31T01:02:40.000Z | 2022-03-31T01:02:40.000Z | glrestore/version.py | MrOlm/glrestore | 60d0140135b7b290aec73a92ab40bafaa4f00ece | [
"MIT"
] | null | null | null | glrestore/version.py | MrOlm/glrestore | 60d0140135b7b290aec73a92ab40bafaa4f00ece | [
"MIT"
] | null | null | null | # Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = '1.0.1' | 42.2 | 60 | 0.729858 | # 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = '1.0.1' | true | true |
1c179088e77cf5de570689d6112d1d60c2c3039f | 6,040 | py | Python | gtdefs.py | joshuafuller/pyGT | 90a5d274aee8b3fb49e0d88ba529b6ab2b0dc70b | [
"MIT"
] | 7 | 2019-01-05T18:07:33.000Z | 2021-12-16T00:37:24.000Z | gtdefs.py | joshuafuller/pyGT | 90a5d274aee8b3fb49e0d88ba529b6ab2b0dc70b | [
"MIT"
] | 2 | 2020-08-14T15:54:11.000Z | 2021-03-24T12:32:18.000Z | gtdefs.py | joshuafuller/pyGT | 90a5d274aee8b3fb49e0d88ba529b6ab2b0dc70b | [
"MIT"
] | 5 | 2019-08-03T10:20:44.000Z | 2021-04-25T05:48:44.000Z |
""" Constants, lists and definitions for pyGT driver
Warning: ALLCAPS SPOKEN HERE
Contains several sets of definitions, grouped under headings:
1) Bluetooth protocol level
2) Bluetooth API level
3a) API object level (non-message)
3b) Message envelope level
4) Message content level
"""
#
#... | 29.753695 | 74 | 0.672185 |
GT_BLE_STX = 0x1002
GT_BLE_ETX = 0x1003
GT_UUID_ST = "12762b18-df5e-11e6-bf01-fe55135034f3"
GT_UUID_TX = "1276b20a-df5e-11e6-bf01-fe55135034f3"
GT_UUID_RX = "1276b20b-df5e-11e6-bf01-fe55135034f3"
OP_FLASH = 0x00 OP_SET_GID = 0x01 OP_SET_PUB = 0x02 OP_SENDMSG = 0x03 # Send a message (shout, direct, ... | true | true |
1c17910d2e55dc1b0fa0bfacbbb1182d77f92469 | 3,340 | py | Python | test_webhook.py | Peter-Nhan/dnacenter_webhook_receiver | 7b49fa2f8c9eb8c828545f9ac0d5b9f5a70dafd0 | [
"BSD-Source-Code"
] | 3 | 2022-03-14T17:16:11.000Z | 2022-03-29T19:01:49.000Z | test_webhook.py | Peter-Nhan/dnacenter_webhook_receiver | 7b49fa2f8c9eb8c828545f9ac0d5b9f5a70dafd0 | [
"BSD-Source-Code"
] | null | null | null | test_webhook.py | Peter-Nhan/dnacenter_webhook_receiver | 7b49fa2f8c9eb8c828545f9ac0d5b9f5a70dafd0 | [
"BSD-Source-Code"
] | 3 | 2021-11-24T09:06:07.000Z | 2022-01-21T16:17:26.000Z | import requests
import json
import urllib3
from requests.auth import HTTPBasicAuth # for Basic Auth
from urllib3.exceptions import InsecureRequestWarning # for insecure https warnings
urllib3.disable_warnings(InsecureRequestWarning) # disable insecure https warnings
from config import WEBHOOK_URL, WEBHOOK_USERNA... | 36.703297 | 162 | 0.680539 | import requests
import json
import urllib3
from requests.auth import HTTPBasicAuth
from urllib3.exceptions import InsecureRequestWarning
urllib3.disable_warnings(InsecureRequestWarning)
from config import WEBHOOK_URL, WEBHOOK_USERNAME, WEBHOOK_PASSWORD
dnac_param = {
"version": "",
"instanceId": "ea6e... | true | true |
1c17915676e4c1499bb0b38854c5c678909ffa53 | 1,353 | py | Python | src/DCGAN/other/create_gif.py | jimmy-academia/GAN_studies | b3198e0290ac3b78a2b3e949a89aea43e532e558 | [
"MIT"
] | 1 | 2019-02-06T07:53:14.000Z | 2019-02-06T07:53:14.000Z | src/DCGAN/other/create_gif.py | jimmy-academia/GAN_studies | b3198e0290ac3b78a2b3e949a89aea43e532e558 | [
"MIT"
] | null | null | null | src/DCGAN/other/create_gif.py | jimmy-academia/GAN_studies | b3198e0290ac3b78a2b3e949a89aea43e532e558 | [
"MIT"
] | null | null | null | ### I'm just gonna do it dirty
import argparse
import imageio
parser = argparse.ArgumentParser(description='create gifs!')
parser.add_argument('--dir', type=str, help='the directory that has only the items wanted')
parser.add_argument('--out', type=str, default='other', help='output directory')
parser.add_argument('-... | 26.019231 | 91 | 0.728012 |
import argparse
import imageio
parser = argparse.ArgumentParser(description='create gifs!')
parser.add_argument('--dir', type=str, help='the directory that has only the items wanted')
parser.add_argument('--out', type=str, default='other', help='output directory')
parser.add_argument('--name', type=str)
parser.add_ar... | true | true |
1c1791f47d749fa394e08d5d6b0755274f9c57c1 | 1,989 | py | Python | test/test_storage_volume_utilization_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | test/test_storage_volume_utilization_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | test/test_storage_volume_utilization_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... | 52.342105 | 1,052 | 0.788336 |
from __future__ import absolute_import
import unittest
import intersight
from intersight.models.storage_volume_utilization_ref import StorageVolumeUtilizationRef from intersight.rest import ApiException
class TestStorageVolumeUtilizationRef(unittest.TestCase):
def setUp(self):
pass
def tearDown(s... | true | true |
1c17920ddf366087744f6cad104f895a9367595d | 4,155 | py | Python | CDInventory.py | DJ-TMC/IT_FDN_110_A_TMC | 739b5d126c080bb93af4b2c6900c4f9508df10cf | [
"MIT"
] | null | null | null | CDInventory.py | DJ-TMC/IT_FDN_110_A_TMC | 739b5d126c080bb93af4b2c6900c4f9508df10cf | [
"MIT"
] | null | null | null | CDInventory.py | DJ-TMC/IT_FDN_110_A_TMC | 739b5d126c080bb93af4b2c6900c4f9508df10cf | [
"MIT"
] | null | null | null | #------------------------------------------#
# Title: CDInventory.py
# Desc: Starter Script for Assignment 05
# Change Log: (Who, When, What)
# DBiesinger, 2030-Jan-01, Created File
# TMcFarland, 2021_Feb_14, Mod to use Dictionaries, added load inventory & delete inventory functionality
#-------------------------... | 41.55 | 138 | 0.528039 |
strChoice = '' lstTbl = [] dctRow = {} strFileName = 'CDInventory.txt' objFile = None
print('The Magic CD Inventory\n')
while True:
print('[l] load Inventory from file\n[a] Add CD\n[i] Display Current Inventory')
print('[d] delete CD from Inventory\n[s] Save Inventory to file\n[x] exit')
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.