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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76ca9743b103784e6372324d967ff1508fa3961 | 6,427 | py | Python | examples/get_power_redundancy.py | jixj5/python-redfish-lenovo | 0b4a5d633a2b1fcee3bf22f06fd35f59b7806d70 | [
"Apache-2.0"
] | null | null | null | examples/get_power_redundancy.py | jixj5/python-redfish-lenovo | 0b4a5d633a2b1fcee3bf22f06fd35f59b7806d70 | [
"Apache-2.0"
] | null | null | null | examples/get_power_redundancy.py | jixj5/python-redfish-lenovo | 0b4a5d633a2b1fcee3bf22f06fd35f59b7806d70 | [
"Apache-2.0"
] | null | null | null | ###
#
# Lenovo Redfish examples - Get power redundancy
#
# Copyright Notice:
#
# Copyright 2018 Lenovo 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.o... | 44.944056 | 127 | 0.603703 |
import sys
import redfish
import json
import traceback
import lenovo_utils as utils
def get_power_redundancy(ip, login_account, login_password):
result = {}
login_host = "https://" + ip
REDFISH_OBJ = redfish.redfish_client(base_url=login_host, username=login_account, timeout=utils.g_timeout,
... | true | true |
f76ca998eab0ed313c8f895c0407e0de651400a9 | 5,649 | py | Python | jobs/gopherci.py | LegacyManagement/gopherbot | 27fd5c3d9daa3ee4071fc6282c7ad996766f69d0 | [
"MIT"
] | 39 | 2018-03-14T21:00:27.000Z | 2022-01-19T18:50:53.000Z | jobs/gopherci.py | LegacyManagement/gopherbot | 27fd5c3d9daa3ee4071fc6282c7ad996766f69d0 | [
"MIT"
] | 140 | 2018-03-15T14:35:48.000Z | 2022-03-31T19:57:08.000Z | jobs/gopherci.py | LegacyManagement/gopherbot | 27fd5c3d9daa3ee4071fc6282c7ad996766f69d0 | [
"MIT"
] | 9 | 2018-03-10T19:20:00.000Z | 2021-09-05T11:18:14.000Z | #!/usr/bin/env python3
# gopherci.py - Dispatcher for commit events, spawns the appropriate build job.
# NOTE: Don't use SetParameter(...) here; build_triggered jobs don't inherit
# environment.
# Operation:
# When a repository updates, gopherci is called with the repository
# name and branch (two arguments).
# - If ... | 39.503497 | 157 | 0.619402 |
import sys
from gopherbot_v2 import Robot
bot = Robot()
repodata = bot.GetRepoData()
if not isinstance(repodata, dict):
bot.Log("Warn", "GopherCI triggered with invalid 'repositories.yaml', not a python 'dict'")
exit(0)
build_triggered = False
sys.argv.pop(0)
def get_deps(repository, recurse, all_deps ... | true | true |
f76ca9d3cb471eb2fb3a9792799414093a7cba09 | 2,243 | py | Python | Scripts/Census/Census_5yr_CA_top50_mig_counties_0917.py | hassenmorad/CA-Migration | 762434b3a013f2488c382dbdc3d2dc7b7f91c572 | [
"MIT"
] | null | null | null | Scripts/Census/Census_5yr_CA_top50_mig_counties_0917.py | hassenmorad/CA-Migration | 762434b3a013f2488c382dbdc3d2dc7b7f91c572 | [
"MIT"
] | null | null | null | Scripts/Census/Census_5yr_CA_top50_mig_counties_0917.py | hassenmorad/CA-Migration | 762434b3a013f2488c382dbdc3d2dc7b7f91c572 | [
"MIT"
] | null | null | null | # Top 50 in/out migration counties for 5-yr estimates, each year b/w 05-09 to 13-17
import pandas as pd
import numpy as np
census5yr = pd.read_csv('ca_counties_mig_5yr_0917.csv')
ca0917 = census5yr[((census5yr.County1FIPS > 6000) & (census5yr.County1FIPS < 7000)) & (census5yr.County2FIPS < 60000) & (census5yr.State2Na... | 50.977273 | 201 | 0.648239 | import pandas as pd
import numpy as np
census5yr = pd.read_csv('ca_counties_mig_5yr_0917.csv')
ca0917 = census5yr[((census5yr.County1FIPS > 6000) & (census5yr.County1FIPS < 7000)) & (census5yr.County2FIPS < 60000) & (census5yr.State2Name != 'California')].sort_values('MovedOut', ascending=False)
for year in ca0917.Ye... | true | true |
f76cac41b509817fce7594ede72c27444764d6a1 | 419 | py | Python | ex7.py | EiEiKyaw/python-exercise | 63dcc073f55f125de784eb61aa7c82a50ca706ed | [
"MIT"
] | null | null | null | ex7.py | EiEiKyaw/python-exercise | 63dcc073f55f125de784eb61aa7c82a50ca706ed | [
"MIT"
] | null | null | null | ex7.py | EiEiKyaw/python-exercise | 63dcc073f55f125de784eb61aa7c82a50ca706ed | [
"MIT"
] | null | null | null | print("Mary had a little lamb.")
print("Its fleece was white as {}.".format('snow'))
print("And everywhere that Mary went.")
print("."*10)#what'd that do?
end1="C"
end2="h"
end3="e"
end4="e"
end5="s"
end6="e"
end7="B"
end8="u"
end9="r"
end10="g"
end11="e"
end12="r"
#watch that comma at the end. try removing it to see... | 18.217391 | 65 | 0.675418 | print("Mary had a little lamb.")
print("Its fleece was white as {}.".format('snow'))
print("And everywhere that Mary went.")
print("."*10)
end1="C"
end2="h"
end3="e"
end4="e"
end5="s"
end6="e"
end7="B"
end8="u"
end9="r"
end10="g"
end11="e"
end12="r"
#watch that comma at the end. try removing it to see what happens
pri... | true | true |
f76cac6c463120aed9e6657a18d225be28fa28e8 | 12,032 | py | Python | groupdocs_signature_cloud/models/stamp_line.py | groupdocs-signature-cloud/groupdocs-signature-cloud-python | 2b7f03b3d70f191dc1292f6221ed9301811681cf | [
"MIT"
] | null | null | null | groupdocs_signature_cloud/models/stamp_line.py | groupdocs-signature-cloud/groupdocs-signature-cloud-python | 2b7f03b3d70f191dc1292f6221ed9301811681cf | [
"MIT"
] | null | null | null | groupdocs_signature_cloud/models/stamp_line.py | groupdocs-signature-cloud/groupdocs-signature-cloud-python | 2b7f03b3d70f191dc1292f6221ed9301811681cf | [
"MIT"
] | 1 | 2021-02-03T00:18:17.000Z | 2021-02-03T00:18:17.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose Pty Ltd" file="StampLine.py">
# Copyright (c) 2003-2021 Aspose Pty Ltd
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of t... | 29.782178 | 222 | 0.576961 |
import pprint
import re
import six
class StampLine(object):
swagger_types = {
'height': 'int',
'background_color': 'Color',
'text': 'str',
'font': 'SignatureFont',
'text_color': 'Color',
'text_bottom_intent': 'int',
'text_repeat_type': 'str',
'ou... | true | true |
f76cace36364393e44372b9cf246ce0ab1ae2740 | 1,581 | py | Python | demos/demo_trifinger_platform_log.py | open-dynamic-robot-initiative/robot_fingers | d186117dd1a1d7dcd7d38ae8fc847a972db24629 | [
"BSD-3-Clause"
] | 32 | 2020-06-20T15:23:16.000Z | 2022-01-02T00:21:40.000Z | demos/demo_trifinger_platform_log.py | open-dynamic-robot-initiative/robot_fingers | d186117dd1a1d7dcd7d38ae8fc847a972db24629 | [
"BSD-3-Clause"
] | 13 | 2020-03-02T10:54:19.000Z | 2021-03-30T14:15:29.000Z | demos/demo_trifinger_platform_log.py | open-dynamic-robot-initiative/robot_fingers | d186117dd1a1d7dcd7d38ae8fc847a972db24629 | [
"BSD-3-Clause"
] | 9 | 2020-08-12T09:29:17.000Z | 2021-11-27T13:04:16.000Z | #!/usr/bin/env python3
"""Demo showing how to use TriFingerPlatformLog."""
import argparse
import cv2
import robot_fingers
from trifinger_cameras import utils
def main():
parser = argparse.ArgumentParser()
parser.add_argument("robot_log", type=str, help="Robot log file")
parser.add_argument("camera_log"... | 28.745455 | 76 | 0.636306 | import argparse
import cv2
import robot_fingers
from trifinger_cameras import utils
def main():
parser = argparse.ArgumentParser()
parser.add_argument("robot_log", type=str, help="Robot log file")
parser.add_argument("camera_log", type=str, help="Camera log file")
parser.add_argument(
"--wit... | true | true |
f76cad27ef9211cc0da51ed59ae5d894efa1f7cc | 17,282 | py | Python | redfish-client/rfclient.py | Power8Chang/python-redfish | 8ac8a9bb4658584e747c8e1580836d727d666b33 | [
"Apache-2.0"
] | 10 | 2015-09-02T15:30:06.000Z | 2020-10-17T18:45:01.000Z | redfish-client/rfclient.py | Power8Chang/python-redfish | 8ac8a9bb4658584e747c8e1580836d727d666b33 | [
"Apache-2.0"
] | 68 | 2015-05-27T07:30:35.000Z | 2022-02-07T22:00:18.000Z | redfish-client/rfclient.py | Power8Chang/python-redfish | 8ac8a9bb4658584e747c8e1580836d727d666b33 | [
"Apache-2.0"
] | 24 | 2015-05-26T17:48:50.000Z | 2022-02-07T15:32:12.000Z | #!/usr/bin/python
# coding=utf-8
'''
redfish-client
This is a client using the python-redfish library to retrieve and perform
action on redfish compatible systems.
'''
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
fr... | 37.326134 | 79 | 0.582919 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
from builtins import str
from builtins import object
import os
import sys
import time
import json
import docopt
import logging
impor... | true | true |
f76cad6d4550b053dca9c75bd71e8c0b5c0e6773 | 2,459 | py | Python | h/migrations/versions/4c0c44605c09_create_annotation_table.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | 1 | 2020-06-19T01:49:39.000Z | 2020-06-19T01:49:39.000Z | h/migrations/versions/4c0c44605c09_create_annotation_table.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | 5 | 2019-10-31T14:23:18.000Z | 2019-11-15T19:24:27.000Z | h/migrations/versions/4c0c44605c09_create_annotation_table.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | null | null | null | """Create annotation table
Revision ID: 4c0c44605c09
Revises: 4886d7a14074
Create Date: 2016-01-20 12:58:16.249481
"""
# revision identifiers, used by Alembic.
revision = "4c0c44605c09"
down_revision = "21f87f395e26"
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from h.d... | 30.358025 | 88 | 0.608377 |
revision = "4c0c44605c09"
down_revision = "21f87f395e26"
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from h.db import types
def upgrade():
op.create_table(
"annotation",
sa.Column(
"id",
types.URLSafeUUID,
server_... | true | true |
f76cadcf624382328b055dedd6937056caa06908 | 5,545 | py | Python | python/pyspark/java_gateway.py | sven0726/spark-1 | 471690f90f3bf29735faecd83d4671842c57b164 | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 2 | 2017-02-07T07:19:31.000Z | 2017-08-30T09:16:21.000Z | python/pyspark/java_gateway.py | luoxuehuan/spark2.01 | d198fcce5e88636cdbbab7d7b84d9977827004dc | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 3 | 2015-05-16T02:46:55.000Z | 2021-12-09T23:08:07.000Z | python/pyspark/java_gateway.py | luoxuehuan/spark2.01 | d198fcce5e88636cdbbab7d7b84d9977827004dc | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"PostgreSQL",
"BSD-3-Clause"
] | 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 us... | 46.991525 | 100 | 0.674662 |
import atexit
import os
import sys
import select
import signal
import shlex
import socket
import platform
from subprocess import Popen, PIPE
if sys.version >= '3':
xrange = range
from py4j.java_gateway import java_import, JavaGateway, GatewayClient
from pyspark.serializers import read_int
def launch_gateway():... | true | true |
f76cae60b921b4446de035c28c50cb993b0663c3 | 1,099 | py | Python | Raspberry Pi/rpi_dev_files/rpi_car_interface_test/rpi_car_interface_test.py | UvinduW/Project-Intelligent-Car | a3d6b8bde8afb6adf173d582f025c3ee135de90a | [
"MIT"
] | 5 | 2018-11-25T20:39:16.000Z | 2021-09-30T20:49:57.000Z | Raspberry Pi/rpi_dev_files/rpi_car_interface_test/rpi_car_interface_test.py | UvinduW/Project-Intelligent-Car | a3d6b8bde8afb6adf173d582f025c3ee135de90a | [
"MIT"
] | 1 | 2018-02-10T20:38:42.000Z | 2018-02-10T20:38:42.000Z | Raspberry Pi/rpi_dev_files/rpi_car_interface_test/rpi_car_interface_test.py | UvinduW/Project-Intelligent-Car | a3d6b8bde8afb6adf173d582f025c3ee135de90a | [
"MIT"
] | 1 | 2018-09-28T13:57:11.000Z | 2018-09-28T13:57:11.000Z | # rpi_car_interface_test.py
# Created: 2017.11.10
# Uvindu Wijesinghe and Oliver Wilkins
#
# Description:
# This program sets up a serial port and allows the Raspberry Pi to
# send data to the Arduino that is connected to the USB port.
# This can be used to control the driving speed and steering input
# of the car
#
... | 28.921053 | 67 | 0.757052 |
import serial
arduino = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
speed = 90
angle = 90
instruction = str(speed).zfill(3) + str(angle).zfill(3)
print (instruction)
arduino.write(instruction.encode()) | true | true |
f76caf6983b4cc61bc7fafd203a8253a2eb0ea87 | 12,934 | py | Python | sympy/physics/quantum/circuitplot.py | clyring/sympy | 54d7726c182065fc25df69b5d1030e568931d82f | [
"BSD-3-Clause"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | sympy/physics/quantum/circuitplot.py | clyring/sympy | 54d7726c182065fc25df69b5d1030e568931d82f | [
"BSD-3-Clause"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | sympy/physics/quantum/circuitplot.py | leosartaj/sympy | 28d913d3cead6c5646307ffa6540b21d65059dfd | [
"BSD-3-Clause"
] | 1 | 2018-10-22T09:17:11.000Z | 2018-10-22T09:17:11.000Z | """Matplotlib based plotting of quantum circuits.
Todo:
* Optimize printing of large circuits.
* Get this to work with single gates.
* Do a better job checking the form of circuits to make sure it is a Mul of
Gates.
* Get multi-target gates plotting.
* Get initial and final states to plot.
* Get measurements to plo... | 34.307692 | 86 | 0.522422 |
from __future__ import print_function, division
from sympy import Mul
from sympy.core.compatibility import range
from sympy.external import import_module
from sympy.physics.quantum.gate import Gate, OneQubitGate, CGate, CGateS
from sympy.core.core import BasicMeta
from sympy.core.assumptions import ManagedProperties
... | true | true |
f76cafa814cd7794e0b20a1e7440224ea06bd4e1 | 56,868 | py | Python | os_ken/app/rest_vtep.py | rolaya/os-ken | 10009e41539c737c7c423f13e4f5bc5f46d219ff | [
"Apache-2.0"
] | 1 | 2019-04-24T04:01:07.000Z | 2019-04-24T04:01:07.000Z | os_ken/app/rest_vtep.py | anlaneg/os-ken | 379a7694c3129cc0156343af71f4fca8830d9de5 | [
"Apache-2.0"
] | null | null | null | os_ken/app/rest_vtep.py | anlaneg/os-ken | 379a7694c3129cc0156343af71f4fca8830d9de5 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2016 Nippon Telegraph and Telephone 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 appli... | 30.856213 | 95 | 0.487234 |
import json
from os_ken.app.ofctl import api as ofctl_api
from os_ken.app.wsgi import ControllerBase
from os_ken.app.wsgi import Response
from os_ken.app.wsgi import route
from os_ken.app.wsgi import WSGIApplication
from os_ken.base import app_manager
from os_ken.exception import OSKenException
from os_ken.lib.ovs i... | true | true |
f76cb1510853f15fdd050c785232624d2e5c1838 | 11,729 | py | Python | pyvlm/classes/latticesurface.py | Xero64/pyvlm | f373ac826cc65281245a69979eb28786fbf67bd0 | [
"MIT"
] | 2 | 2019-06-21T16:01:38.000Z | 2019-09-06T11:36:08.000Z | pyvlm/classes/latticesurface.py | Xero64/pyvlm | f373ac826cc65281245a69979eb28786fbf67bd0 | [
"MIT"
] | 5 | 2019-09-06T11:37:50.000Z | 2021-05-12T16:36:10.000Z | pyvlm/classes/latticesurface.py | Xero64/pyvlm | f373ac826cc65281245a69979eb28786fbf67bd0 | [
"MIT"
] | 2 | 2021-03-20T19:51:22.000Z | 2022-01-11T07:50:28.000Z | from math import sqrt
from pygeom.matrix3d import zero_matrix_vector
from matplotlib.pyplot import figure
from .latticesheet import LatticeSheet
from .latticepanel import LatticePanel
class LatticeSurface(object):
name = None
scts = None
shts = None
cspc = None
xspace = None
strps = None
pn... | 33.321023 | 74 | 0.52059 | from math import sqrt
from pygeom.matrix3d import zero_matrix_vector
from matplotlib.pyplot import figure
from .latticesheet import LatticeSheet
from .latticepanel import LatticePanel
class LatticeSurface(object):
name = None
scts = None
shts = None
cspc = None
xspace = None
strps = None
pn... | true | true |
f76cb163cf2ba251cf232116a314eb5f1d322370 | 10,763 | py | Python | python/uw/like2/analyze/gc_comparison.py | tburnett/pointlike | a556f07650c2f17d437c86fdafe9f9a33f59758e | [
"BSD-3-Clause"
] | 1 | 2019-03-19T14:45:28.000Z | 2019-03-19T14:45:28.000Z | python/uw/like2/analyze/gc_comparison.py | tburnett/pointlike | a556f07650c2f17d437c86fdafe9f9a33f59758e | [
"BSD-3-Clause"
] | null | null | null | python/uw/like2/analyze/gc_comparison.py | tburnett/pointlike | a556f07650c2f17d437c86fdafe9f9a33f59758e | [
"BSD-3-Clause"
] | 1 | 2018-08-24T18:58:27.000Z | 2018-08-24T18:58:27.000Z | """
Comparison of a UW model with a GC analysis
$Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/like2/analyze/gc_comparison.py,v 1.3 2017/11/17 22:43:17 burnett Exp $
"""
import os
from astropy.io import fits as pyfits
import numpy as np
import pylab as plt
import pandas as pd
from astropy.io import fits
f... | 39.424908 | 130 | 0.569265 | """
Comparison of a UW model with a GC analysis
$Header: /nfs/slac/g/glast/ground/cvs/pointlike/python/uw/like2/analyze/gc_comparison.py,v 1.3 2017/11/17 22:43:17 burnett Exp $
"""
import os
from astropy.io import fits as pyfits
import numpy as np
import pylab as plt
import pandas as pd
from astropy.io import fits
f... | false | true |
f76cb2072a1333bb23f13683818fe66d7240aadd | 112 | py | Python | src/swingtime/context_processors.py | kehindeadewusi/django-swingtime | 02da9f40137f7e112a168c8a6a46379eb6a9ef56 | [
"MIT"
] | null | null | null | src/swingtime/context_processors.py | kehindeadewusi/django-swingtime | 02da9f40137f7e112a168c8a6a46379eb6a9ef56 | [
"MIT"
] | 1 | 2018-09-20T14:45:14.000Z | 2018-09-20T14:45:14.000Z | src/swingtime/context_processors.py | kehindeadewusi/django-swingtime | 02da9f40137f7e112a168c8a6a46379eb6a9ef56 | [
"MIT"
] | 2 | 2018-08-29T08:37:26.000Z | 2018-09-14T07:37:04.000Z | from datetime import datetime
def current_datetime(request):
return dict(current_datetime=datetime.now())
| 18.666667 | 48 | 0.794643 | from datetime import datetime
def current_datetime(request):
return dict(current_datetime=datetime.now())
| true | true |
f76cb28b99501bdaeb7d36965049d620c7c4935e | 1,058 | py | Python | amadeus/safety/safety_rated_locations/_by_square.py | minjikarin/amadeus-python | 14a004912ee8c36ee4fd79651ea1b23afe6b2a6e | [
"MIT"
] | 125 | 2018-04-09T07:27:24.000Z | 2022-02-22T11:45:20.000Z | amadeus/safety/safety_rated_locations/_by_square.py | minjikarin/amadeus-python | 14a004912ee8c36ee4fd79651ea1b23afe6b2a6e | [
"MIT"
] | 58 | 2018-03-29T14:58:01.000Z | 2022-03-17T10:18:07.000Z | amadeus/safety/safety_rated_locations/_by_square.py | minjikarin/amadeus-python | 14a004912ee8c36ee4fd79651ea1b23afe6b2a6e | [
"MIT"
] | 58 | 2018-04-06T10:56:20.000Z | 2022-03-04T01:23:24.000Z | from amadeus.client.decorator import Decorator
class BySquare(Decorator, object):
def get(self, **params):
'''
Returns detailed safety ranking of all the districts
within the designated area.
.. code-block:: python
amadeus.safety.safety_rated_locations.by_square.g... | 32.060606 | 76 | 0.579395 | from amadeus.client.decorator import Decorator
class BySquare(Decorator, object):
def get(self, **params):
return self.client.get(
'/v1/safety/safety-rated-locations/by-square', **params)
| true | true |
f76cb318b939efd709269d7756f8f129f7e08c79 | 215 | py | Python | shared/customlogging/filter.py | uorocketry/can-rgx | cf2fef4019df36103eb11ce79259348630ae1c9d | [
"MIT"
] | null | null | null | shared/customlogging/filter.py | uorocketry/can-rgx | cf2fef4019df36103eb11ce79259348630ae1c9d | [
"MIT"
] | 35 | 2020-12-31T19:59:45.000Z | 2021-09-10T16:40:52.000Z | shared/customlogging/filter.py | uorocketry/can-rgx | cf2fef4019df36103eb11ce79259348630ae1c9d | [
"MIT"
] | null | null | null | import logging
class SensorFilter(logging.Filter):
"""
Filters out records starting with the level "sensorlog"
"""
def filter(self, record):
return not record.name.startswith("sensorlog")
| 19.545455 | 59 | 0.67907 | import logging
class SensorFilter(logging.Filter):
def filter(self, record):
return not record.name.startswith("sensorlog")
| true | true |
f76cb31d52e2a57197c95ff3e721ceba35a1da40 | 8,107 | py | Python | starkbank/utilitypayment/__utilitypayment.py | starkbank/sdk-python | ed184601771869f5f2e6c34a6138491bbfcb3d5d | [
"MIT"
] | 6 | 2021-02-04T18:00:13.000Z | 2022-02-17T03:22:03.000Z | starkbank/utilitypayment/__utilitypayment.py | starkbank/sdk-python | ed184601771869f5f2e6c34a6138491bbfcb3d5d | [
"MIT"
] | 4 | 2020-04-17T06:37:22.000Z | 2020-11-24T20:49:52.000Z | starkbank/utilitypayment/__utilitypayment.py | starkbank/sdk-python | ed184601771869f5f2e6c34a6138491bbfcb3d5d | [
"MIT"
] | 3 | 2020-02-20T16:08:12.000Z | 2020-11-24T20:10:14.000Z | from ..utils import rest
from ..utils.checks import check_datetime, check_date
from ..utils.resource import Resource
class UtilityPayment(Resource):
"""# UtilityPayment object
When you initialize a UtilityPayment, the entity will not be automatically
created in the Stark Bank API. The 'create' function se... | 52.986928 | 227 | 0.711854 | from ..utils import rest
from ..utils.checks import check_datetime, check_date
from ..utils.resource import Resource
class UtilityPayment(Resource):
def __init__(self, description, line=None, bar_code=None, tags=None, scheduled=None, id=None, amount=None, fee=None, transaction_ids=None, status=None, created=None... | true | true |
f76cb32035e5ab9ca9661f5ce2d33621734e3eaf | 3,285 | py | Python | test/orm/test_lazytest1.py | obeattie/sqlalchemy | 376007fed7746d494dcb0166b22e512bfece02cd | [
"MIT"
] | 2 | 2016-05-09T09:17:35.000Z | 2016-08-03T16:30:16.000Z | test/orm/test_lazytest1.py | clones/sqlalchemy | c9f08aa78a48ba53dd221d3c5de54e5956ecf806 | [
"MIT"
] | null | null | null | test/orm/test_lazytest1.py | clones/sqlalchemy | c9f08aa78a48ba53dd221d3c5de54e5956ecf806 | [
"MIT"
] | null | null | null | import sqlalchemy as sa
from sqlalchemy.test import testing
from sqlalchemy import Integer, String, ForeignKey
from sqlalchemy.test.schema import Table
from sqlalchemy.test.schema import Column
from sqlalchemy.orm import mapper, relation, create_session
from test.orm import _base
class LazyTest(_base.MappedTest):
... | 35.322581 | 75 | 0.528463 | import sqlalchemy as sa
from sqlalchemy.test import testing
from sqlalchemy import Integer, String, ForeignKey
from sqlalchemy.test.schema import Table
from sqlalchemy.test.schema import Column
from sqlalchemy.orm import mapper, relation, create_session
from test.orm import _base
class LazyTest(_base.MappedTest):
... | true | true |
f76cb34d37af7d81b5e628d06c1a4cfe126f8bb4 | 4,100 | py | Python | ppocr/modeling/heads/det_db_head.py | nan-wang/PaddleOCR | 31b06a2fd19f877a09acaf658387bd919c289b8e | [
"Apache-2.0"
] | 20,401 | 2020-05-08T10:56:13.000Z | 2022-03-31T23:34:38.000Z | ppocr/modeling/heads/det_db_head.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4,988 | 2020-05-10T08:19:41.000Z | 2022-03-31T17:57:11.000Z | ppocr/modeling/heads/det_db_head.py | justld/PaddleOCR | 09604c38e42591c240771edbbff43a6dd7ebf592 | [
"Apache-2.0"
] | 4,479 | 2020-05-08T11:12:13.000Z | 2022-03-31T11:55:28.000Z | # copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.745763 | 80 | 0.627073 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import paddle
from paddle import nn
import paddle.nn.functional as F
from paddle import ParamAttr
def get_bias_attr(k):
stdv = 1.0 / math.sqrt(k * 1.0)
initializer = paddle.nn.initializer... | true | true |
f76cb3dd04fe96c8f1338510f4fc571f2c334146 | 441 | py | Python | dollar/exec_dollar.py | developerHaneum/currencyConverter | 8481b374950df916e4243c30a0dc8e45c48c611d | [
"MIT"
] | null | null | null | dollar/exec_dollar.py | developerHaneum/currencyConverter | 8481b374950df916e4243c30a0dc8e45c48c611d | [
"MIT"
] | null | null | null | dollar/exec_dollar.py | developerHaneum/currencyConverter | 8481b374950df916e4243c30a0dc8e45c48c611d | [
"MIT"
] | null | null | null | # 간단 환율계산 (달러)
from datetime import *
clock = datetime.now()
ymd = "%s 년 %s 월 %s 일"%(clock.year, clock.month, clock.day)
_usd_ = 1126.97
def Conversion(v, c):
return v * c # 환율
print("-- 간단 환율 계산 (달러) --")
print("-> 환율: %s 기준 -<"%ymd)
while True:
value = float(input("달러(0:quit): "))
if value == 0.0:
... | 23.210526 | 59 | 0.548753 | from datetime import *
clock = datetime.now()
ymd = "%s 년 %s 월 %s 일"%(clock.year, clock.month, clock.day)
_usd_ = 1126.97
def Conversion(v, c):
return v * c
print("-- 간단 환율 계산 (달러) --")
print("-> 환율: %s 기준 -<"%ymd)
while True:
value = float(input("달러(0:quit): "))
if value == 0.0:
print("=> 종료 <=")... | true | true |
f76cb4ba3cd4779c736e00482f4938354519b828 | 36,657 | py | Python | pysat/_files.py | pysat/pysat | 4d12a09ea585b88d54560413e03cae9289113718 | [
"BSD-3-Clause"
] | 68 | 2019-09-18T19:08:07.000Z | 2022-03-28T23:22:04.000Z | pysat/_files.py | iamaSam/pysat | 4d12a09ea585b88d54560413e03cae9289113718 | [
"BSD-3-Clause"
] | 603 | 2019-09-18T15:24:37.000Z | 2022-03-30T20:13:43.000Z | pysat/_files.py | iamaSam/pysat | 4d12a09ea585b88d54560413e03cae9289113718 | [
"BSD-3-Clause"
] | 24 | 2015-04-08T09:33:51.000Z | 2019-09-06T22:01:34.000Z | #!/usr/bin/env python
# Full license can be found in License.md
# Full author list can be found in .zenodo.json file
# DOI:10.5281/zenodo.1199703
# ----------------------------------------------------------------------------
import copy
import datetime as dt
from functools import partial
import numpy as np
import os
i... | 38.667722 | 80 | 0.565949 |
import copy
import datetime as dt
from functools import partial
import numpy as np
import os
import weakref
import pandas as pds
import pysat from pysat.utils import files as futils
from pysat.utils.time import filter_datetime_input
from pysat.instruments.methods import general
logger = pysat.logger
class Files(... | true | true |
f76cb70a223b846b8faed018ea3010f297188e2f | 261 | py | Python | tmp.py | betterenvi/QA-rank | 9e709e5fd85212145c98a3bf3cd5007eb76e1ffc | [
"MIT"
] | 35 | 2016-12-06T12:35:19.000Z | 2021-02-03T14:47:11.000Z | tmp.py | betterenvi/QA-rank | 9e709e5fd85212145c98a3bf3cd5007eb76e1ffc | [
"MIT"
] | 1 | 2017-06-01T03:12:22.000Z | 2017-06-10T11:51:36.000Z | tmp.py | betterenvi/QA-rank | 9e709e5fd85212145c98a3bf3cd5007eb76e1ffc | [
"MIT"
] | 15 | 2016-12-18T15:52:36.000Z | 2021-02-02T08:30:17.000Z | import sys, os, collections, copy
import numpy as np
import pandas as pd
from pandas import DataFrame, Series
data_fn = 'data/WikiQA-train.tsv'
X = pd.read_csv(data_fn, sep='\t', header=0, dtype=str, skiprows=None, na_values='?', keep_default_na=False)
| 32.625 | 109 | 0.731801 | import sys, os, collections, copy
import numpy as np
import pandas as pd
from pandas import DataFrame, Series
data_fn = 'data/WikiQA-train.tsv'
X = pd.read_csv(data_fn, sep='\t', header=0, dtype=str, skiprows=None, na_values='?', keep_default_na=False)
| true | true |
f76cb71c638d1fcc19026efe08ce071323916460 | 1,248 | py | Python | src/other/Other_from_2020-2021/home/caculator.py | jonahmakowski/PyWrskp | 93950d5bf6173f1507560ea719a6e1ed1387c95c | [
"MIT"
] | null | null | null | src/other/Other_from_2020-2021/home/caculator.py | jonahmakowski/PyWrskp | 93950d5bf6173f1507560ea719a6e1ed1387c95c | [
"MIT"
] | null | null | null | src/other/Other_from_2020-2021/home/caculator.py | jonahmakowski/PyWrskp | 93950d5bf6173f1507560ea719a6e1ed1387c95c | [
"MIT"
] | null | null | null | # This is a simple calculator in the shell
def use(num1, t, num2):
try:
num1 = float(num1)
num2 = float(num2)
if t == '+':
a = num1 + num2
q = '{} + {}'.format(num1, num2)
elif t == '-':
a = num1 - num2
q = '{} - {}'.format(num1, num2)... | 31.2 | 110 | 0.455929 |
def use(num1, t, num2):
try:
num1 = float(num1)
num2 = float(num2)
if t == '+':
a = num1 + num2
q = '{} + {}'.format(num1, num2)
elif t == '-':
a = num1 - num2
q = '{} - {}'.format(num1, num2)
elif t == '*':
a = num... | true | true |
f76cb736dade37125ea43cb72af903bb2902a493 | 6,899 | py | Python | docs/source/conf.py | ktoth17/contrast-variation-rsoxs | 0fd4c9aa6c3415949f1835616bec177c6525155a | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | ktoth17/contrast-variation-rsoxs | 0fd4c9aa6c3415949f1835616bec177c6525155a | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | ktoth17/contrast-variation-rsoxs | 0fd4c9aa6c3415949f1835616bec177c6525155a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Contrast Variation Resonant Soft X-ray Scattering documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 28 12:35:56 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all pos... | 33.985222 | 172 | 0.684882 |
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.githubpages',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'IPython.sphinxext.ipython_directive',
'IPython.sphinxext.ipython_console_highlighting',
'matplotlib.sphi... | true | true |
f76cb7cf1b887f0a9e88473b3be3761ad3a2dfe0 | 11,458 | py | Python | test/other/test_custom_task_manager.py | polarG/splunk-connect-for-snmp | d1e85675edd5caa5bad9114d1611411e15cec063 | [
"Apache-2.0"
] | null | null | null | test/other/test_custom_task_manager.py | polarG/splunk-connect-for-snmp | d1e85675edd5caa5bad9114d1611411e15cec063 | [
"Apache-2.0"
] | null | null | null | test/other/test_custom_task_manager.py | polarG/splunk-connect-for-snmp | d1e85675edd5caa5bad9114d1611411e15cec063 | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from unittest.mock import MagicMock, Mock, patch
from splunk_connect_for_snmp.customtaskmanager import CustomPeriodicTaskManager
class TestCustomTaskManager(TestCase):
@patch("celerybeatmongo.models.PeriodicTask.objects")
def test_delete_unused_poll_tasks(self, m_objects):
... | 32.551136 | 86 | 0.640862 | from unittest import TestCase
from unittest.mock import MagicMock, Mock, patch
from splunk_connect_for_snmp.customtaskmanager import CustomPeriodicTaskManager
class TestCustomTaskManager(TestCase):
@patch("celerybeatmongo.models.PeriodicTask.objects")
def test_delete_unused_poll_tasks(self, m_objects):
... | true | true |
f76cb8f429c2d9d279766a33bff12453d9ddd84e | 5,892 | py | Python | bin/household_bills/xlrd-upwork.py | desafinadude/municipal-data | 1c86c55bbb59f9c8087f6920fae3585dd90d5d43 | [
"MIT"
] | 19 | 2018-01-09T10:54:15.000Z | 2022-01-25T13:10:55.000Z | bin/household_bills/xlrd-upwork.py | desafinadude/municipal-data | 1c86c55bbb59f9c8087f6920fae3585dd90d5d43 | [
"MIT"
] | 29 | 2018-01-12T12:12:38.000Z | 2022-01-31T15:30:36.000Z | bin/household_bills/xlrd-upwork.py | desafinadude/municipal-data | 1c86c55bbb59f9c8087f6920fae3585dd90d5d43 | [
"MIT"
] | 13 | 2018-02-11T02:12:57.000Z | 2021-11-22T11:03:22.000Z | import re
import sys
import csv
import xlrd
from copy import copy
INPUT_FILE = "/Users/tomaszkolek/Downloads/buffalo.xls"
# INPUT_FILE = "/Users/tomaszkolek/Downloads/Nelson Bay.xls"
OUTPUT_BILLS = "bill.csv"
OUTPUT_INCREASE = "increase.csv"
IGNORE_COLUMN = ["Budget Year 2019/20 % incr"]
IGNORE_ROW = ["sub-total"]
C... | 33.288136 | 111 | 0.706721 | import re
import sys
import csv
import xlrd
from copy import copy
INPUT_FILE = "/Users/tomaszkolek/Downloads/buffalo.xls"
OUTPUT_BILLS = "bill.csv"
OUTPUT_INCREASE = "increase.csv"
IGNORE_COLUMN = ["Budget Year 2019/20 % incr"]
IGNORE_ROW = ["sub-total"]
CLASS_REGEX = "Monthly Account for Household - (?P<class>.*)"
... | true | true |
f76cb976c2eca2e68f91550b4cefac3fcc274f90 | 4,586 | bzl | Python | tools/defaults.bzl | JWTappert/material2 | 7f5d08fc6b04c594d1d6fbc1cfbcd8482a2aa27b | [
"MIT"
] | null | null | null | tools/defaults.bzl | JWTappert/material2 | 7f5d08fc6b04c594d1d6fbc1cfbcd8482a2aa27b | [
"MIT"
] | null | null | null | tools/defaults.bzl | JWTappert/material2 | 7f5d08fc6b04c594d1d6fbc1cfbcd8482a2aa27b | [
"MIT"
] | null | null | null | # Re-export of Bazel rules with repository-wide defaults
load("@angular//:index.bzl", _ng_module = "ng_module")
load("@build_bazel_rules_nodejs//:defs.bzl", _jasmine_node_test = "jasmine_node_test")
load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library",
_ts_web_test_suite = "ts_web_test_suite")... | 35.550388 | 98 | 0.684038 |
load("@angular//:index.bzl", _ng_module = "ng_module")
load("@build_bazel_rules_nodejs//:defs.bzl", _jasmine_node_test = "jasmine_node_test")
load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library",
_ts_web_test_suite = "ts_web_test_suite")
_DEFAULT_TSCONFIG_BUILD = "//src:bazel-tsconfig-build.j... | true | true |
f76cbad12d384aead9121e07e028c0508e9b21fe | 9,570 | py | Python | ucscentralsdk/mometa/vnic/VnicEtherIf.py | ragupta-git/ucscentralsdk | 2678008b5fb6b0fafafec388d0874147e95a1086 | [
"Apache-2.0"
] | null | null | null | ucscentralsdk/mometa/vnic/VnicEtherIf.py | ragupta-git/ucscentralsdk | 2678008b5fb6b0fafafec388d0874147e95a1086 | [
"Apache-2.0"
] | null | null | null | ucscentralsdk/mometa/vnic/VnicEtherIf.py | ragupta-git/ucscentralsdk | 2678008b5fb6b0fafafec388d0874147e95a1086 | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for VnicEtherIf ManagedObject."""
from ...ucscentralmo import ManagedObject
from ...ucscentralcoremeta import UcsCentralVersion, MoPropertyMeta, MoMeta
from ...ucscentralmeta import VersionMeta
class VnicEtherIfConsts():
ADDR_DERIVED = "derived"
DEFAULT_NET_FAL... | 80.420168 | 3,045 | 0.712226 |
from ...ucscentralmo import ManagedObject
from ...ucscentralcoremeta import UcsCentralVersion, MoPropertyMeta, MoMeta
from ...ucscentralmeta import VersionMeta
class VnicEtherIfConsts():
ADDR_DERIVED = "derived"
DEFAULT_NET_FALSE = "false"
DEFAULT_NET_NO = "no"
DEFAULT_NET_TRUE = "true"
DEFAULT_N... | true | true |
f76cbb1a0834ad955bb6d18b050918ec548f65c3 | 10,416 | py | Python | data/model/dcrnn_model.py | ys2899/DCAR | 154cf46fd45dec8639efb6aeb348b25db32c497b | [
"MIT"
] | null | null | null | data/model/dcrnn_model.py | ys2899/DCAR | 154cf46fd45dec8639efb6aeb348b25db32c497b | [
"MIT"
] | null | null | null | data/model/dcrnn_model.py | ys2899/DCAR | 154cf46fd45dec8639efb6aeb348b25db32c497b | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import pdb
from tensorflow.contrib import legacy_seq2seq
from lib.metrics import masked_mae_loss
from model.dcrnn_cell import DCGRUCell
class DCRNNARModel(object):
def __init__(s... | 41.831325 | 136 | 0.605031 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import pdb
from tensorflow.contrib import legacy_seq2seq
from lib.metrics import masked_mae_loss
from model.dcrnn_cell import DCGRUCell
class DCRNNARModel(object):
def __init__(s... | true | true |
f76cbc683b74db72f1304fcd7f67553cd9658568 | 3,725 | py | Python | openstack_dashboard/dashboards/identity/mappings/tests.py | NunoEdgarGFlowHub/horizon | 73a0bbd43ea78ac5337f7d00977ec5f32452067e | [
"Apache-2.0"
] | 1 | 2018-04-17T02:32:05.000Z | 2018-04-17T02:32:05.000Z | openstack_dashboard/dashboards/identity/mappings/tests.py | NunoEdgarGFlowHub/horizon | 73a0bbd43ea78ac5337f7d00977ec5f32452067e | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/identity/mappings/tests.py | NunoEdgarGFlowHub/horizon | 73a0bbd43ea78ac5337f7d00977ec5f32452067e | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2015 Yahoo! 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... | 34.490741 | 76 | 0.615302 |
import json
from django import http
from django.urls import reverse
from mox3.mox import IgnoreArg
from mox3.mox import IsA
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
MAPPINGS_INDEX_URL = reverse('horizon:identity:mappings:index')
MAPPINGS_CREATE_URL = reverse('horizo... | true | true |
f76cbc9472a6e8fd242fe33148ea67844a1792a7 | 51,282 | py | Python | Lib/test/test_calendar.py | finefoot/cpython | ffcc7cd57f6a52c6074ecc9f0a9f0177fb1dbfee | [
"0BSD"
] | 2 | 2022-03-27T14:52:48.000Z | 2022-03-27T17:35:22.000Z | Lib/test/test_calendar.py | finefoot/cpython | ffcc7cd57f6a52c6074ecc9f0a9f0177fb1dbfee | [
"0BSD"
] | 8 | 2022-01-07T11:31:11.000Z | 2022-03-04T00:07:16.000Z | Lib/test/test_calendar.py | finefoot/cpython | ffcc7cd57f6a52c6074ecc9f0a9f0177fb1dbfee | [
"0BSD"
] | 1 | 2022-03-27T18:34:54.000Z | 2022-03-27T18:34:54.000Z | import calendar
import unittest
from test import support
from test.support.script_helper import assert_python_ok, assert_python_failure
import time
import locale
import sys
import datetime
import os
# From https://en.wikipedia.org/wiki/Leap_year_starting_on_Saturday
result_0_02_text = """\
February 0
Mo Tu We Th... | 51.436309 | 206 | 0.579209 | import calendar
import unittest
from test import support
from test.support.script_helper import assert_python_ok, assert_python_failure
import time
import locale
import sys
import datetime
import os
result_0_02_text = """\
February 0
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 1... | true | true |
f76cbcb22efe4781bbabfef60fd776d57df55325 | 22,670 | py | Python | src/sage/geometry/hyperplane_arrangement/hyperplane.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | 3 | 2016-06-19T14:48:31.000Z | 2022-01-28T08:46:01.000Z | src/sage/geometry/hyperplane_arrangement/hyperplane.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | null | null | null | src/sage/geometry/hyperplane_arrangement/hyperplane.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | 7 | 2021-11-08T10:01:59.000Z | 2022-03-03T11:25:52.000Z | r"""
Hyperplanes
.. NOTE::
If you want to learn about Sage's hyperplane arrangements then you
should start with
:mod:`sage.geometry.hyperplane_arrangement.arrangement`. This
module is used to represent the individual hyperplanes, but you
should never construct the classes from this module directly... | 29.711664 | 98 | 0.539524 |
from sage.misc.cachefunc import cached_method
from sage.geometry.linear_expression import LinearExpression, LinearExpressionModule
class Hyperplane(LinearExpression):
def __init__(self, parent, coefficients, constant):
super(Hyperplane, self).__init__(parent, coefficients, constant)
def _repr_(se... | true | true |
f76cbd72a449cabd0e7c9292e50a97f510c35e05 | 1,439 | py | Python | google-cloud-sdk/lib/googlecloudsdk/api_lib/events/metric_names.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/googlecloudsdk/api_lib/events/metric_names.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | 4 | 2020-07-21T12:51:46.000Z | 2022-01-22T10:29:25.000Z | google-cloud-sdk/lib/googlecloudsdk/api_lib/events/metric_names.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | 1 | 2020-07-25T18:17:57.000Z | 2020-07-25T18:17:57.000Z | # -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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 requir... | 30.617021 | 74 | 0.770674 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
_EVENTS_PREFIX = 'events_'
GET_TRIGGER = _EVENTS_PREFIX + 'get_trigger'
CREATE_TRIGGER = _EVENTS_PREFIX + 'create_trigger'
LIST_TRIGGERS = _EVENTS_PREFIX + 'list_triggers'
DELETE_TRIGGER = _EVENTS_PREFIX... | true | true |
f76cbe55535c51a8e533ba02804e8ad4f6eba282 | 460 | py | Python | models/mlp.py | wang-chen/graph-action-recognition | 319a5287c3fb58f233a8b56ed70f5be94703aa61 | [
"BSD-3-Clause"
] | 2 | 2021-12-18T07:10:40.000Z | 2022-03-06T16:24:06.000Z | models/mlp.py | wang-chen/graph-action-recognition | 319a5287c3fb58f233a8b56ed70f5be94703aa61 | [
"BSD-3-Clause"
] | null | null | null | models/mlp.py | wang-chen/graph-action-recognition | 319a5287c3fb58f233a8b56ed70f5be94703aa61 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import torch
import torch.nn as nn
class MLP(nn.Module):
def __init__(self):
super().__init__()
self.feat1 = nn.Sequential(nn.Flatten(), nn.Linear(50*5*5, 32*5*5), nn.ReLU())
self.feat2 = nn.Sequential(nn.Linear(32*5*5, 32*12), nn.ReLU())
self.linear = nn.Se... | 25.555556 | 86 | 0.593478 |
import torch
import torch.nn as nn
class MLP(nn.Module):
def __init__(self):
super().__init__()
self.feat1 = nn.Sequential(nn.Flatten(), nn.Linear(50*5*5, 32*5*5), nn.ReLU())
self.feat2 = nn.Sequential(nn.Linear(32*5*5, 32*12), nn.ReLU())
self.linear = nn.Sequential(nn.Linear(32*1... | true | true |
f76cbee1b08187c83ef0b65a29040463ca163d17 | 382 | py | Python | sources/day-02.py | cyclechen/teach-gf-python | b07d3a43cee4156bf9f35da692adcd4e39213686 | [
"Apache-2.0"
] | null | null | null | sources/day-02.py | cyclechen/teach-gf-python | b07d3a43cee4156bf9f35da692adcd4e39213686 | [
"Apache-2.0"
] | null | null | null | sources/day-02.py | cyclechen/teach-gf-python | b07d3a43cee4156bf9f35da692adcd4e39213686 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import xlrd
# 打开文件
data = xlrd.open_workbook('file/demo.xlsx')
# 查看工作表
data.sheet_names()
print("sheets:" + str(data.sheet_names()))
# 通过文件名获得工作表,获取工作表1
table = data.sheet_by_name('工作表1')
# 获取某个单元格的值,例如获取B3单元格值
cel_B3 = table.cell(3,2).value
print("第三行第二列的值:" + cel_B3)
#D列+5
cel_... | 18.190476 | 44 | 0.675393 |
import xlrd
data = xlrd.open_workbook('file/demo.xlsx')
data.sheet_names()
print("sheets:" + str(data.sheet_names()))
table = data.sheet_by_name('工作表1')
cel_B3 = table.cell(3,2).value
print("第三行第二列的值:" + cel_B3)
cel_D2=table.cell(1,3).value+5
print("D2的正确年龄:"+str(int(cel_D2))) | true | true |
f76cbf680aea07cb8fe3c84a8416c1f386c4363f | 1,135 | py | Python | meiduo_mall/meiduo_mall/utils/fastdfs/fdfs_storage.py | Noah-Smith-wgp/meiduo_project | f1350a50dabd33d90c2c5b3509d590603aeda6e4 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/utils/fastdfs/fdfs_storage.py | Noah-Smith-wgp/meiduo_project | f1350a50dabd33d90c2c5b3509d590603aeda6e4 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/utils/fastdfs/fdfs_storage.py | Noah-Smith-wgp/meiduo_project | f1350a50dabd33d90c2c5b3509d590603aeda6e4 | [
"MIT"
] | null | null | null | from django.core.files.storage import Storage
from django.conf import settings
class FastDFSStorage(Storage):
"""自定义文件存储系统,修改存储的方案"""
def __init__(self, fdfs_base_url=None):
"""
构造方法,可以不带参数,也可以携带参数
:param base_url: 存储服务器的位置
"""
self.fdfs_base_url = fdfs_base_url or set... | 26.395349 | 96 | 0.597357 | from django.core.files.storage import Storage
from django.conf import settings
class FastDFSStorage(Storage):
def __init__(self, fdfs_base_url=None):
self.fdfs_base_url = fdfs_base_url or settings.FDFS_BASE_URL
def _open(self, name, mode='rb'):
pass
def _save(self, name, content... | true | true |
f76cc18c7330febf4e27dd602ed3d276a2cb21e2 | 164 | py | Python | fun/views.py | xiaom-coder/mysite | 72f2afbb623c582712cef2892474a992919eebd9 | [
"MIT"
] | null | null | null | fun/views.py | xiaom-coder/mysite | 72f2afbb623c582712cef2892474a992919eebd9 | [
"MIT"
] | null | null | null | fun/views.py | xiaom-coder/mysite | 72f2afbb623c582712cef2892474a992919eebd9 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, My fun. You're at the Test index.")
| 20.5 | 67 | 0.762195 | from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, My fun. You're at the Test index.")
| true | true |
f76cc19cd30f1c423a09600bce7f16c1099060d3 | 1,065 | py | Python | python-pass.py | PeshrawSarwar/GIZ-pass-python | b78358db8949f0520460e3d69a38100491d0183d | [
"MIT"
] | null | null | null | python-pass.py | PeshrawSarwar/GIZ-pass-python | b78358db8949f0520460e3d69a38100491d0183d | [
"MIT"
] | null | null | null | python-pass.py | PeshrawSarwar/GIZ-pass-python | b78358db8949f0520460e3d69a38100491d0183d | [
"MIT"
] | null | null | null |
class Solution(object):
@staticmethod
def longest_palindromic(s: str):
# Square Matrix - length = length of the string [False]
matrix = [[False for i in range(len(s))] for i in range(len(s))]
for i in range(len(s)):
# major diagonal elements = True
matrix[i... | 29.583333 | 72 | 0.444131 |
class Solution(object):
@staticmethod
def longest_palindromic(s: str):
matrix = [[False for i in range(len(s))] for i in range(len(s))]
for i in range(len(s)):
matrix[i][i] = True
max_length = 1
start = 0
for l in range(2,le... | true | true |
f76cc2b8e74aecb513638b9956d62aacc2c5c1fd | 10,617 | py | Python | tests/ignite/distributed/utils/test_native.py | jkhenning/ignite | c3f80910fb39ee101f07afe21172754c01026927 | [
"BSD-3-Clause"
] | 1 | 2021-08-10T05:32:29.000Z | 2021-08-10T05:32:29.000Z | tests/ignite/distributed/utils/test_native.py | rishabhvarshney14/ignite | 2485fd42c6ef4d3e97fd606a52f8c6e5d940357e | [
"BSD-3-Clause"
] | null | null | null | tests/ignite/distributed/utils/test_native.py | rishabhvarshney14/ignite | 2485fd42c6ef4d3e97fd606a52f8c6e5d940357e | [
"BSD-3-Clause"
] | null | null | null | import os
import pytest
import torch
import torch.distributed as dist
import ignite.distributed as idist
from ignite.distributed.utils import has_native_dist_support
from tests.ignite.distributed.utils import (
_test_distrib_all_gather,
_test_distrib_all_reduce,
_test_distrib_barrier,
_test_distrib_br... | 35.747475 | 114 | 0.778186 | import os
import pytest
import torch
import torch.distributed as dist
import ignite.distributed as idist
from ignite.distributed.utils import has_native_dist_support
from tests.ignite.distributed.utils import (
_test_distrib_all_gather,
_test_distrib_all_reduce,
_test_distrib_barrier,
_test_distrib_br... | true | true |
f76cc2e197abb89579473004a155f652765fd9e9 | 5,672 | py | Python | mojo/public/tools/bindings/pylib/mojom/generate/generator.py | xzhan96/chromium.src | 1bd0cf3997f947746c0fc5406a2466e7b5f6159e | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-01-07T18:51:03.000Z | 2021-01-07T18:51:03.000Z | mojo/public/tools/bindings/pylib/mojom/generate/generator.py | emilio/chromium.src | 1bd0cf3997f947746c0fc5406a2466e7b5f6159e | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | mojo/public/tools/bindings/pylib/mojom/generate/generator.py | emilio/chromium.src | 1bd0cf3997f947746c0fc5406a2466e7b5f6159e | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Code shared by the various language-specific code generators."""
from functools import partial
import os.path
import re
import module as mojom
import mo... | 37.071895 | 80 | 0.722849 |
"""Code shared by the various language-specific code generators."""
from functools import partial
import os.path
import re
import module as mojom
import mojom.fileutil as fileutil
import pack
def ExpectedArraySize(kind):
if mojom.IsArrayKind(kind):
return kind.length
return None
def StudlyCapsToCamel(studl... | false | true |
f76cc313868e32ad143d12a996d89ae072463800 | 67,037 | py | Python | truffe2/generic/views.py | TeoGoddet/truffe2 | 23a963d404e5f719c0eeb273f52223ff5e3e5263 | [
"BSD-2-Clause"
] | null | null | null | truffe2/generic/views.py | TeoGoddet/truffe2 | 23a963d404e5f719c0eeb273f52223ff5e3e5263 | [
"BSD-2-Clause"
] | null | null | null | truffe2/generic/views.py | TeoGoddet/truffe2 | 23a963d404e5f719c0eeb273f52223ff5e3e5263 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404, render, redirect
from django.views.decorators.csrf import csrf_exempt
from django.http import Http404, HttpResponse, HttpResponseNotFound
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators impo... | 41.871955 | 317 | 0.618106 |
from django.shortcuts import get_object_or_404, render, redirect
from django.views.decorators.csrf import csrf_exempt
from django.http import Http404, HttpResponse, HttpResponseNotFound
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from d... | true | true |
f76cc38ebcec6f0940b047f39b261b9da713f3b1 | 4,089 | py | Python | tests/test_unit/test_detect.py | loftwah/CleverCSV | c7d0cab7b19d969dbbda2bcafb414ca2973facf5 | [
"MIT"
] | 1 | 2020-01-14T14:22:09.000Z | 2020-01-14T14:22:09.000Z | tests/test_unit/test_detect.py | loftwah/CleverCSV | c7d0cab7b19d969dbbda2bcafb414ca2973facf5 | [
"MIT"
] | 2 | 2021-03-31T19:35:55.000Z | 2021-12-13T20:17:29.000Z | tests/test_unit/test_detect.py | loftwah/CleverCSV | c7d0cab7b19d969dbbda2bcafb414ca2973facf5 | [
"MIT"
] | 1 | 2020-10-07T16:44:55.000Z | 2020-10-07T16:44:55.000Z | # -*- coding: utf-8 -*-
"""
Unit tests for the dialect detection.
Author: Gertjan van den Burg
"""
import unittest
from clevercsv.detect import Detector
class DetectorTestCase(unittest.TestCase):
# Initially we copy the results from CPython test suite.
sample1 = """\
Harry's, Arlington Heights, IL, 2/1/... | 34.075 | 82 | 0.644901 |
import unittest
from clevercsv.detect import Detector
class DetectorTestCase(unittest.TestCase):
sample1 = """\
Harry's, Arlington Heights, IL, 2/1/03, Kimi Hayes
Shark City, Glendale Heights, IL, 12/28/02, Prezence
Tommy's Place, Blue Island, IL, 12/28/02, Blue Sunday/White Crow
Stonecutters Seafood and ... | true | true |
f76cc46e5ab0b3fadc6eefa2c31f50a1cf2f1213 | 653 | py | Python | demo.py | vivekvkt/programing_coding_test | 882fdc3512f7c0a518e722534659bc1493a5626b | [
"MIT"
] | null | null | null | demo.py | vivekvkt/programing_coding_test | 882fdc3512f7c0a518e722534659bc1493a5626b | [
"MIT"
] | null | null | null | demo.py | vivekvkt/programing_coding_test | 882fdc3512f7c0a518e722534659bc1493a5626b | [
"MIT"
] | null | null | null | # class A:
# def sum(self):
# print("A")
# class B:
# def sum(self):
# print("B")
# class C(B,A):
# pass
# o = C()
# o.sum()
# n =12345
# sum =0
# temp = n
# num = n %10
# rev = rev*10+num
# digit = n//10
# if temp== rev:
# this is palindrome
# else:
# this is not palindrome
... | 11.660714 | 39 | 0.542113 |
x = "abcdef"
while i in x:
print(i)
| true | true |
f76cc5067ce5c038178465f3cddb057930e84ad8 | 18,959 | py | Python | ENV/lib/python3.6/site-packages/pyramid/tests/test_static.py | captain-c00keys/pyramid-stocks | 0acf3363a6a7ee61cd41b855f43c9d6f9582ae6a | [
"MIT"
] | null | null | null | ENV/lib/python3.6/site-packages/pyramid/tests/test_static.py | captain-c00keys/pyramid-stocks | 0acf3363a6a7ee61cd41b855f43c9d6f9582ae6a | [
"MIT"
] | null | null | null | ENV/lib/python3.6/site-packages/pyramid/tests/test_static.py | captain-c00keys/pyramid-stocks | 0acf3363a6a7ee61cd41b855f43c9d6f9582ae6a | [
"MIT"
] | null | null | null | import datetime
import os.path
import unittest
here = os.path.dirname(__file__)
# 5 years from now (more or less)
fiveyrsfuture = datetime.datetime.utcnow() + datetime.timedelta(5*365)
class Test_static_view_use_subpath_False(unittest.TestCase):
def _getTargetClass(self):
from pyramid.static import stati... | 39.66318 | 80 | 0.624558 | import datetime
import os.path
import unittest
here = os.path.dirname(__file__)
fiveyrsfuture = datetime.datetime.utcnow() + datetime.timedelta(5*365)
class Test_static_view_use_subpath_False(unittest.TestCase):
def _getTargetClass(self):
from pyramid.static import static_view
return static_view
... | true | true |
f76cc6abb76faae2b49095a1c7afba2c458b93d9 | 12,527 | py | Python | nova/tests/unit/scheduler/filters/test_trusted_filters.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | 5 | 2017-06-23T07:37:39.000Z | 2020-10-21T07:07:50.000Z | nova/tests/unit/scheduler/filters/test_trusted_filters.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/scheduler/filters/test_trusted_filters.py | bopopescu/nested_quota_final | 7c3454883de9f5368fa943924540eebe157a319d | [
"Apache-2.0"
] | 4 | 2017-06-23T07:37:43.000Z | 2020-12-28T09:57:22.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 47.271698 | 79 | 0.595753 |
import mock
from oslo_config import cfg
from oslo_serialization import jsonutils
from oslo_utils import timeutils
import requests
from nova import objects
from nova.scheduler.filters import trusted_filter
from nova import test
from nova.tests.unit.scheduler import fakes
CONF = cfg.CONF
class AttestationServiceTest... | true | true |
f76cc8138f8fc8c5051420bb118d7caed9934703 | 5,511 | py | Python | scripts/build_pypi_sanity_test.py | rcramblit/pyre-check | fa15d2021ab1bf5b52aae8c09d1520e2b7bcf6c9 | [
"MIT"
] | null | null | null | scripts/build_pypi_sanity_test.py | rcramblit/pyre-check | fa15d2021ab1bf5b52aae8c09d1520e2b7bcf6c9 | [
"MIT"
] | null | null | null | scripts/build_pypi_sanity_test.py | rcramblit/pyre-check | fa15d2021ab1bf5b52aae8c09d1520e2b7bcf6c9 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import json
import subprocess
import tempfile
from pathlib import Path
from typing import Any
from venv import EnvBuilder
cl... | 36.496689 | 88 | 0.614045 |
import argparse
import json
import subprocess
import tempfile
from pathlib import Path
from typing import Any
from venv import EnvBuilder
class AssertionError(Exception):
pass
def production_assert(value: bool, *args: Any) -> None:
if not value:
raise AssertionError(*args)
def validate_configurat... | true | true |
f76cc81af50a9000c890e7ce24d9eb40cc6dab4c | 1,196 | py | Python | code/metric.py | t1191578/moniteredit | 48465d7cbee2452392720a26320d8753f8807bc9 | [
"Apache-2.0"
] | null | null | null | code/metric.py | t1191578/moniteredit | 48465d7cbee2452392720a26320d8753f8807bc9 | [
"Apache-2.0"
] | null | null | null | code/metric.py | t1191578/moniteredit | 48465d7cbee2452392720a26320d8753f8807bc9 | [
"Apache-2.0"
] | null | null | null | from flask import Flask ,request
from flask_restful import Resource, Api
import requests
app =Flask(__name__)
api = Api(app)
#cluster = {'metric': {'name':"slurm_nodes_idle" ,'instance':"35.209.219.226:8080",'job':"slurm2"},
# 'value':{0:1593766788.942, '1':"3"}}
#resp = requests.get('http://15.206.250.89:9... | 36.242424 | 103 | 0.678094 | from flask import Flask ,request
from flask_restful import Resource, Api
import requests
app =Flask(__name__)
api = Api(app)
resp = requests.get('http://35.154.106.147:9090/api/v1/query?query=slurm_cpus_total')
if resp.status_code != 200:
raise ApiError('GET /cluster/ {}'.format(resp.status_code))
val= resp.js... | true | true |
f76cc8327f15b7667c312fac6cf8e85655675cf4 | 485 | py | Python | python全栈/day15/day15-15 列表内字典数据排序.py | Ringo-li/python_exercise_100 | 2c6c42b84a88ffbbac30c67ffbd7bad3418eda14 | [
"MIT"
] | null | null | null | python全栈/day15/day15-15 列表内字典数据排序.py | Ringo-li/python_exercise_100 | 2c6c42b84a88ffbbac30c67ffbd7bad3418eda14 | [
"MIT"
] | null | null | null | python全栈/day15/day15-15 列表内字典数据排序.py | Ringo-li/python_exercise_100 | 2c6c42b84a88ffbbac30c67ffbd7bad3418eda14 | [
"MIT"
] | null | null | null | # 对列表中的字典按照某一个key值进行排序
# 对于每个对象有不同属性,多个对象组成一个组合的情况,可以适用
students = [
{'name':'Tom', 'age':18},
{'name':'Rose', 'age':16},
{'name':'Jack', 'age':17}
]
# 按name值升序排序
students1 = students.copy()
students1.sort(key=lambda x: x['name'])
print(students1)
# 按name值降序排序
students2 = students.copy()
students2.sort(k... | 21.086957 | 53 | 0.686598 |
students = [
{'name':'Tom', 'age':18},
{'name':'Rose', 'age':16},
{'name':'Jack', 'age':17}
]
students1 = students.copy()
students1.sort(key=lambda x: x['name'])
print(students1)
students2 = students.copy()
students2.sort(key=lambda x: x['name'], reverse=True)
print(students2)
students3 = students.copy(... | true | true |
f76cc8521b9bb4c53b76e9494a66bc2449efd1d9 | 13,546 | py | Python | home_seller_app/migrations/0001_initial.py | seifgh/home-seller-web-app | f4cc1e893f86fe3e67f300b536354ec97455b132 | [
"MIT"
] | null | null | null | home_seller_app/migrations/0001_initial.py | seifgh/home-seller-web-app | f4cc1e893f86fe3e67f300b536354ec97455b132 | [
"MIT"
] | 4 | 2020-06-07T13:14:11.000Z | 2022-03-12T00:32:41.000Z | home_seller_app/migrations/0001_initial.py | seifgh/home-seller-web-app | f4cc1e893f86fe3e67f300b536354ec97455b132 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-05-25 10:01
from django.conf import settings
import django.contrib.postgres.indexes
import django.contrib.postgres.search
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = Tr... | 54.620968 | 205 | 0.590802 |
from django.conf import settings
import django.contrib.postgres.indexes
import django.contrib.postgres.search
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations =... | true | true |
f76cc9018f6cae099c4fcad1e8d79cdbfd60f92a | 11,000 | py | Python | tests/core/test_agent.py | zhangyanbo2007/rasa | 86b315b9f4ca40d71ef51669d8b7d830a09cb72f | [
"Apache-2.0"
] | null | null | null | tests/core/test_agent.py | zhangyanbo2007/rasa | 86b315b9f4ca40d71ef51669d8b7d830a09cb72f | [
"Apache-2.0"
] | null | null | null | tests/core/test_agent.py | zhangyanbo2007/rasa | 86b315b9f4ca40d71ef51669d8b7d830a09cb72f | [
"Apache-2.0"
] | null | null | null | import asyncio
from typing import Any, Dict, Text, List, Callable, Optional
from unittest.mock import Mock
import pytest
from _pytest.logging import LogCaptureFixture
from _pytest.monkeypatch import MonkeyPatch
from pytest_sanic.utils import TestClient
from sanic import Sanic, response
from sanic.request import Reques... | 33.43465 | 88 | 0.694364 | import asyncio
from typing import Any, Dict, Text, List, Callable, Optional
from unittest.mock import Mock
import pytest
from _pytest.logging import LogCaptureFixture
from _pytest.monkeypatch import MonkeyPatch
from pytest_sanic.utils import TestClient
from sanic import Sanic, response
from sanic.request import Reques... | true | true |
f76cca8b6b7afd68b30f009055bede5072a2cf27 | 6,043 | py | Python | gpytorch/utils/linear_cg.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | gpytorch/utils/linear_cg.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | gpytorch/utils/linear_cg.py | ediphy-dwild/gpytorch | 559c78a6446237ed7cc8e1cc7cf4ed8bf31a3c8a | [
"MIT"
] | null | null | null | import torch
from .. import settings
def _default_preconditioner(x):
return x.clone()
def linear_cg(matmul_closure, rhs, n_tridiag=0, tolerance=1e-6, eps=1e-20, max_iter=None,
initial_guess=None, preconditioner=None):
"""
Implements the linear conjugate gradients method for (approximately)... | 38.987097 | 118 | 0.653649 | import torch
from .. import settings
def _default_preconditioner(x):
return x.clone()
def linear_cg(matmul_closure, rhs, n_tridiag=0, tolerance=1e-6, eps=1e-20, max_iter=None,
initial_guess=None, preconditioner=None):
is_vector = rhs.ndimension() == 1
if is_vector:
rhs = rhs.un... | true | true |
f76cca92f154001d3a6fbca70020870962e18a1e | 3,591 | py | Python | food/middlewares.py | soubenz/scrapy-projects | abc7fd5e0a9d5831418ab127500569f41dec99f9 | [
"MIT"
] | null | null | null | food/middlewares.py | soubenz/scrapy-projects | abc7fd5e0a9d5831418ab127500569f41dec99f9 | [
"MIT"
] | null | null | null | food/middlewares.py | soubenz/scrapy-projects | abc7fd5e0a9d5831418ab127500569f41dec99f9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class FoodSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy act... | 34.528846 | 78 | 0.665553 |
from scrapy import signals
class FoodSpiderMiddleware(object):
@classmethod
def from_crawler(cls, crawler):
s = cls()
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s
def process_spider_input(self, response, spider):
... | true | true |
f76ccb47167fcf207b2b1f7911ce229d20b0bd82 | 9,566 | py | Python | motion.py | Ohara124c41/Nao-Robot | 83295bc3f51eb2258c6d5b567a7dacd83c3e3287 | [
"MIT"
] | 9 | 2019-11-01T03:53:30.000Z | 2021-12-30T02:52:37.000Z | motion.py | Ohara124c41/Nao-Robot | 83295bc3f51eb2258c6d5b567a7dacd83c3e3287 | [
"MIT"
] | null | null | null | motion.py | Ohara124c41/Nao-Robot | 83295bc3f51eb2258c6d5b567a7dacd83c3e3287 | [
"MIT"
] | 3 | 2019-06-19T13:04:21.000Z | 2020-02-27T14:20:45.000Z | import nao_nocv_2_1 as nao
from naoqi import ALProxy
def InitRobot():
nao.InitProxy("192.168.0.117")
# local = 127.0.0.1
# marvin = 192.168.0.115
# bender = 192.168.0.117
robotIP= "192.168.0.117"
def basicWave():
names = list()
times = list()
keys = list()
names.append("LElbow... | 71.924812 | 392 | 0.499477 | import nao_nocv_2_1 as nao
from naoqi import ALProxy
def InitRobot():
nao.InitProxy("192.168.0.117")
robotIP= "192.168.0.117"
def basicWave():
names = list()
times = list()
keys = list()
names.append("LElbowRoll")
times.append([0.1, 1, 1.5, 2, 2.5, 3.5])
keys.append([[-... | true | true |
f76ccb9fe88eec856e00ecf808a520e6913c2482 | 3,759 | py | Python | tools/nanos_gdb.py | PPPy290351/nanos | e84bf58d92f30677482ae7a79b25a96df4d176d1 | [
"Apache-2.0"
] | 1 | 2021-12-05T08:41:20.000Z | 2021-12-05T08:41:20.000Z | tools/nanos_gdb.py | PPPy290351/nanos | e84bf58d92f30677482ae7a79b25a96df4d176d1 | [
"Apache-2.0"
] | null | null | null | tools/nanos_gdb.py | PPPy290351/nanos | e84bf58d92f30677482ae7a79b25a96df4d176d1 | [
"Apache-2.0"
] | null | null | null | import gdb
# these definitions and tagof must be in sync with C source
class Tag:
unknown = 0
string = 1
symbol = 2
table_tuple = 3
function_tuple = 4
def tagof(p):
return ((p.cast(typ('u64')) >> 38) & 7)
def typ(s):
return gdb.lookup_type(s)
def get_buffer_string(val):
str = val['co... | 31.588235 | 94 | 0.546954 | import gdb
class Tag:
unknown = 0
string = 1
symbol = 2
table_tuple = 3
function_tuple = 4
def tagof(p):
return ((p.cast(typ('u64')) >> 38) & 7)
def typ(s):
return gdb.lookup_type(s)
def get_buffer_string(val):
str = val['contents'].cast(typ('char').pointer()) + val['start']
retu... | true | true |
f76ccc24b64bb059f993ab56aa94d189a6dc1ab4 | 1,858 | py | Python | lab/refactoring-pep8/docstrings_blank_lines.py | stark276/SPD-2.31-Testing-and-Architecture1 | 8ec4f3a2968a04584f581354925e927ea1bab34d | [
"MIT"
] | null | null | null | lab/refactoring-pep8/docstrings_blank_lines.py | stark276/SPD-2.31-Testing-and-Architecture1 | 8ec4f3a2968a04584f581354925e927ea1bab34d | [
"MIT"
] | null | null | null | lab/refactoring-pep8/docstrings_blank_lines.py | stark276/SPD-2.31-Testing-and-Architecture1 | 8ec4f3a2968a04584f581354925e927ea1bab34d | [
"MIT"
] | null | null | null | # by Kami Bigdely
# Docstrings and blank lines
class OnBoardTemperatureSensor:
VOLTAGE_TO_TEMP_FACTOR = 5.6
def __init__(self):
pass
def read_voltage(self):
return 2.7
def get_temperature(self):
return self.read_voltage() * OnBoardTemperatureSensor.VOLTAGE_TO_TEMP_FACTOR ... | 40.391304 | 153 | 0.720129 | class OnBoardTemperatureSensor:
VOLTAGE_TO_TEMP_FACTOR = 5.6
def __init__(self):
pass
def read_voltage(self):
return 2.7
def get_temperature(self):
return self.read_voltage() * OnBoardTemperatureSensor.VOLTAGE_TO_TEMP_FACTOR
class CarbonMonoxideSensor:
VOLTAGE_TO_C... | true | true |
f76cccee9017bbe884a51e9fb1f4a01b8f3c6598 | 402 | py | Python | apiproject/account/migrations/0007_user_created_at.py | vasulimited123/Django-Repository | 0283dfd6396c58b52000c99667768145a8be3fd2 | [
"MIT"
] | null | null | null | apiproject/account/migrations/0007_user_created_at.py | vasulimited123/Django-Repository | 0283dfd6396c58b52000c99667768145a8be3fd2 | [
"MIT"
] | null | null | null | apiproject/account/migrations/0007_user_created_at.py | vasulimited123/Django-Repository | 0283dfd6396c58b52000c99667768145a8be3fd2 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.12 on 2022-03-13 13:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0006_auto_20220313_1339'),
]
operations = [
migrations.AddField(
model_name='user',
name='created_at',
... | 21.157895 | 65 | 0.606965 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0006_auto_20220313_1339'),
]
operations = [
migrations.AddField(
model_name='user',
name='created_at',
field=models.DateField(auto_now_add=Tr... | true | true |
f76ccee338dd1139307f59ca37bc1da216937ea8 | 1,994 | py | Python | cookiecutter-django-ida/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/local.py | stvstnfrd/edx-cookiecutters | 2721ef24656e199efd416c963b9caefc303b5759 | [
"Apache-2.0"
] | 13 | 2015-11-01T02:58:04.000Z | 2020-04-03T20:33:33.000Z | cookiecutter-django-ida/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/local.py | stvstnfrd/edx-cookiecutters | 2721ef24656e199efd416c963b9caefc303b5759 | [
"Apache-2.0"
] | 38 | 2015-09-10T02:56:11.000Z | 2020-04-27T19:52:45.000Z | cookiecutter-django-ida/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/local.py | stvstnfrd/edx-cookiecutters | 2721ef24656e199efd416c963b9caefc303b5759 | [
"Apache-2.0"
] | 2 | 2015-12-22T07:02:00.000Z | 2019-01-22T19:33:28.000Z | from {{cookiecutter.repo_name}}.settings.base import *
DEBUG = True
# CACHE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}
}
# END CACHE CONFIGURATION
# DATABASE CONFIGURATION
# See:... | 28.084507 | 78 | 0.685055 | from {{cookiecutter.repo_name}}.settings.base import *
DEBUG = True
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': root('default.db'),
'USER': '',
'P... | false | true |
f76ccf23ff9016255a734280fa57fe903e80b8ec | 321 | py | Python | attractions/models.py | Armestrong/Tourist_Attractions | 8bcc60cd135cc92f32d3e82485cb45e1ecd4714a | [
"MIT"
] | null | null | null | attractions/models.py | Armestrong/Tourist_Attractions | 8bcc60cd135cc92f32d3e82485cb45e1ecd4714a | [
"MIT"
] | null | null | null | attractions/models.py | Armestrong/Tourist_Attractions | 8bcc60cd135cc92f32d3e82485cb45e1ecd4714a | [
"MIT"
] | null | null | null | from django.db import models
class ComplementAttraction(models.Model):
name = models.CharField(max_length=150)
description = models.TextField()
opening_hours = models.TextField()
image = models.ImageField(upload_to='attractions', null=True, blank=True)
def __str__(self):
return self.name
... | 24.692308 | 77 | 0.722741 | from django.db import models
class ComplementAttraction(models.Model):
name = models.CharField(max_length=150)
description = models.TextField()
opening_hours = models.TextField()
image = models.ImageField(upload_to='attractions', null=True, blank=True)
def __str__(self):
return self.name
... | true | true |
f76cd0c09795213f120c242ebfccdc80e71ae5d6 | 1,978 | py | Python | cloudferry/tools/mark_volumes_deleted.py | SVilgelm/CloudFerry | 4459c0d21ba7ccffe51176932197b352e426ba63 | [
"Apache-2.0"
] | 6 | 2017-04-20T00:49:49.000Z | 2020-12-20T16:27:10.000Z | cloudferry/tools/mark_volumes_deleted.py | SVilgelm/CloudFerry | 4459c0d21ba7ccffe51176932197b352e426ba63 | [
"Apache-2.0"
] | 3 | 2017-04-08T15:47:16.000Z | 2017-05-18T17:40:59.000Z | cloudferry/tools/mark_volumes_deleted.py | SVilgelm/CloudFerry | 4459c0d21ba7ccffe51176932197b352e426ba63 | [
"Apache-2.0"
] | 8 | 2017-04-07T23:42:36.000Z | 2021-08-10T11:05:10.000Z | # Copyright (c) 2016 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 40.367347 | 73 | 0.645096 |
import logging
from cloudferry.lib.os.storage import cinder_db
from cloudferry.lib.utils import mysql_connector
LOG = logging.getLogger(__name__)
def mark_volumes_deleted(config, volume_ids):
def get_opt(name):
return (getattr(config.src_storage, name) or
getattr(config.src_mysql, name)... | true | true |
f76cd1eb1290f0a5d01a19e91b4313600488bf1e | 19,726 | py | Python | salt/version.py | dr4Ke/salt | 8ffa4903c9ed10c81e1a6c7b967dc9532f320c0b | [
"Apache-2.0"
] | 1 | 2015-08-20T21:55:17.000Z | 2015-08-20T21:55:17.000Z | salt/version.py | dr4Ke/salt | 8ffa4903c9ed10c81e1a6c7b967dc9532f320c0b | [
"Apache-2.0"
] | null | null | null | salt/version.py | dr4Ke/salt | 8ffa4903c9ed10c81e1a6c7b967dc9532f320c0b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Set up the version of Salt
'''
# Import python libs
from __future__ import print_function
import re
import sys
# Import salt libs
try:
from salt._compat import string_types
except ImportError:
if sys.version_info[0] == 3:
string_types = str
else:
string_types = ... | 35.606498 | 118 | 0.486515 |
from __future__ import print_function
import re
import sys
try:
from salt._compat import string_types
except ImportError:
if sys.version_info[0] == 3:
string_types = str
else:
string_types = basestring
#
# ALL OTHER VERSION INFORMATION IS EXTRACTED FROM THE GIT TAGS
#
# <---- ATTENTION --... | true | true |
f76cd309a3b9ae166618905d3ba655d31d3d32b4 | 11,973 | py | Python | sdk/python/pulumi_azure_native/eventgrid/v20200401preview/system_topic.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/eventgrid/v20200401preview/system_topic.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/eventgrid/v20200401preview/system_topic.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 39.514851 | 397 | 0.630836 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = ['SystemTopicArgs', 'SystemTopic']
@pulumi.input_type
class SystemTopicArgs:
def __init__(__self__, *,
resource_grou... | true | true |
f76cd473a0aef5a72a4431e30378d327153910a6 | 129,295 | py | Python | tests/unit/gapic/aiplatform_v1/test_prediction_service.py | sararob/python-aiplatform | e64cd5588848a4dcd9117ff905e9569576541b69 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/aiplatform_v1/test_prediction_service.py | sararob/python-aiplatform | e64cd5588848a4dcd9117ff905e9569576541b69 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/aiplatform_v1/test_prediction_service.py | sararob/python-aiplatform | e64cd5588848a4dcd9117ff905e9569576541b69 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.472496 | 125 | 0.681643 | import os
try:
from unittest import mock
from unittest.mock import AsyncMock
except ImportError:
import mock
import grpc
from grpc.experimental import aio
import math
import pytest
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api import httpbody_pb2 from google.api_core... | true | true |
f76cd48733bf7f3771c9a88f7e25a73bbb307269 | 398 | py | Python | menpo3d/io/__init__.py | apapaion/menpo3d | 09aaeb37fdd9435827041715dc8248e49e63a2d0 | [
"BSD-3-Clause"
] | 134 | 2015-03-14T22:53:45.000Z | 2022-03-26T05:24:32.000Z | menpo3d/io/__init__.py | apapaion/menpo3d | 09aaeb37fdd9435827041715dc8248e49e63a2d0 | [
"BSD-3-Clause"
] | 51 | 2015-02-02T12:48:53.000Z | 2021-05-19T03:20:38.000Z | menpo3d/io/__init__.py | apapaion/menpo3d | 09aaeb37fdd9435827041715dc8248e49e63a2d0 | [
"BSD-3-Clause"
] | 48 | 2015-02-02T16:48:52.000Z | 2022-03-17T15:41:49.000Z | from .input import (
import_builtin_asset,
mesh_paths,
import_landmark_file,
import_landmark_files,
data_path_to,
data_dir_path,
ls_builtin_assets,
landmark_file_paths,
import_mesh,
import_meshes,
register_landmark_importer,
register_mesh_importer,
import_lsfm_model,
... | 23.411765 | 75 | 0.761307 | from .input import (
import_builtin_asset,
mesh_paths,
import_landmark_file,
import_landmark_files,
data_path_to,
data_dir_path,
ls_builtin_assets,
landmark_file_paths,
import_mesh,
import_meshes,
register_landmark_importer,
register_mesh_importer,
import_lsfm_model,
... | true | true |
f76cd56f00ab20fe03d0cedb17e3c9d48dd02524 | 4,340 | py | Python | sdk/python/pulumi_azure_native/web/v20200901/list_static_site_function_app_settings.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20200901/list_static_site_function_app_settings.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/v20200901/list_static_site_function_app_settings.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 32.878788 | 171 | 0.636636 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'ListStaticSiteFunctionAppSettingsResult',
'AwaitableListStaticSiteFunctionAppSettingsResult',
'list_static_site_function_ap... | true | true |
f76cd57afebf6546af927da11409d5829fa20b37 | 2,810 | py | Python | pytorch/tools/setup_helpers/nccl.py | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | 1 | 2019-07-23T11:20:58.000Z | 2019-07-23T11:20:58.000Z | tools/setup_helpers/nccl.py | wxwoods/mctorch | 7cd6eb51fdd01fa75ed9245039a4f145ba342de2 | [
"BSD-3-Clause"
] | 1 | 2019-07-22T09:48:46.000Z | 2019-07-22T09:48:46.000Z | pytorch/tools/setup_helpers/nccl.py | raghavnauhria/whatmt | c20483a437c82936cb0fb8080925e37b9c4bba87 | [
"MIT"
] | null | null | null | import os
import glob
from .env import IS_WINDOWS, IS_DARWIN, IS_CONDA, CONDA_DIR, check_negative_env_flag, \
gather_paths
from .cuda import USE_CUDA, CUDA_HOME
USE_NCCL = USE_CUDA and not check_negative_env_flag('USE_NCCL') and not IS_DARWIN and not IS_WINDOWS
USE_SYSTEM_NCCL = False
NCCL_LIB_DIR = None
NCCL_SY... | 36.493506 | 100 | 0.636299 | import os
import glob
from .env import IS_WINDOWS, IS_DARWIN, IS_CONDA, CONDA_DIR, check_negative_env_flag, \
gather_paths
from .cuda import USE_CUDA, CUDA_HOME
USE_NCCL = USE_CUDA and not check_negative_env_flag('USE_NCCL') and not IS_DARWIN and not IS_WINDOWS
USE_SYSTEM_NCCL = False
NCCL_LIB_DIR = None
NCCL_SY... | true | true |
f76cd68b98e3bdadbe29ff6c4436797c43daaebc | 2,233 | py | Python | cinderclient/v1/limits.py | Thingee/python-cinderclient | 878098d6129b7c606e4a55cde4f316d5da2d532d | [
"Apache-1.1"
] | null | null | null | cinderclient/v1/limits.py | Thingee/python-cinderclient | 878098d6129b7c606e4a55cde4f316d5da2d532d | [
"Apache-1.1"
] | null | null | null | cinderclient/v1/limits.py | Thingee/python-cinderclient | 878098d6129b7c606e4a55cde4f316d5da2d532d | [
"Apache-1.1"
] | null | null | null | # Copyright 2011 OpenStack LLC.
from cinderclient import base
class Limits(base.Resource):
"""A collection of RateLimit and AbsoluteLimit objects."""
def __repr__(self):
return "<Limits>"
@property
def absolute(self):
for (name, value) in list(self._info['absolute'].items()):
... | 27.9125 | 77 | 0.57322 |
from cinderclient import base
class Limits(base.Resource):
def __repr__(self):
return "<Limits>"
@property
def absolute(self):
for (name, value) in list(self._info['absolute'].items()):
yield AbsoluteLimit(name, value)
@property
def rate(self):
for group in ... | true | true |
f76cd6950a3c43b3fd50dea307e1f8393f2e2882 | 1,891 | py | Python | vine/push.py | robinson96/GRAPE | f6404ae6ee2933647e515a9480077ab01fb2c430 | [
"BSD-3-Clause"
] | 4 | 2017-04-30T17:08:42.000Z | 2019-11-15T04:44:09.000Z | vine/push.py | LLNL/GRAPE | f6404ae6ee2933647e515a9480077ab01fb2c430 | [
"BSD-3-Clause"
] | 1 | 2016-02-19T07:24:27.000Z | 2016-02-19T07:24:27.000Z | vine/push.py | robinson96/GRAPE | f6404ae6ee2933647e515a9480077ab01fb2c430 | [
"BSD-3-Clause"
] | null | null | null | import os
import option
import grapeGit as git
import utility
import grapeConfig
class Push(option.Option):
"""
grape push pushes your current branch to origin for your outer level repo and all submodules.
it uses 'git push -u origin HEAD' for the git command.
Usage: grape-push [--noRecurse]
Op... | 27.405797 | 104 | 0.615019 | import os
import option
import grapeGit as git
import utility
import grapeConfig
class Push(option.Option):
"""
grape push pushes your current branch to origin for your outer level repo and all submodules.
it uses 'git push -u origin HEAD' for the git command.
Usage: grape-push [--noRecurse]
Op... | false | true |
f76cd8dabee435be1d963fd08574b2e5044b3fb4 | 10,035 | py | Python | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 30.225904 | 103 | 0.694868 |
from enum import Enum, EnumMeta
from six import with_metaclass
class _CaseInsensitiveEnumMeta(EnumMeta):
def __getitem__(self, name):
return super().__getitem__(name.upper())
def __getattr__(cls, name):
try:
return cls._member_map_[name.upper()]
except KeyError:
... | true | true |
f76cd9c95212150d3b6981c8d747e589cc300409 | 35,358 | py | Python | step.py | skeptycal/citeas-api | fc3ff70e1feec0201d54e70a4d504b658dfae79c | [
"MIT"
] | null | null | null | step.py | skeptycal/citeas-api | fc3ff70e1feec0201d54e70a4d504b658dfae79c | [
"MIT"
] | 1 | 2021-03-20T04:46:45.000Z | 2021-03-20T04:46:45.000Z | step.py | skeptycal/citeas-api | fc3ff70e1feec0201d54e70a4d504b658dfae79c | [
"MIT"
] | null | null | null | import requests
import re
import os
import json
import datetime
import json5
from io import StringIO
from nameparser import HumanName
from bibtex import BibTeX # use local patched version instead of citeproc.source.bibtex
import urllib2
import urlparse
import re
from arxiv2bib import arxiv2bib_dict, is_valid
from uti... | 35.5 | 214 | 0.606313 | import requests
import re
import os
import json
import datetime
import json5
from io import StringIO
from nameparser import HumanName
from bibtex import BibTeX import urllib2
import urlparse
import re
from arxiv2bib import arxiv2bib_dict, is_valid
from util import clean_doi
def step_configs():
configs = {}
f... | false | true |
f76cd9d11f6871c9020c25f0ae842844c5844c61 | 542 | py | Python | Past data/GetPastData.py | Madlhawa/Real-time-Edge-analytics | 9e3e7be1c32f6d33f81ffe27c7eed63f8bbb6f39 | [
"MIT"
] | null | null | null | Past data/GetPastData.py | Madlhawa/Real-time-Edge-analytics | 9e3e7be1c32f6d33f81ffe27c7eed63f8bbb6f39 | [
"MIT"
] | null | null | null | Past data/GetPastData.py | Madlhawa/Real-time-Edge-analytics | 9e3e7be1c32f6d33f81ffe27c7eed63f8bbb6f39 | [
"MIT"
] | null | null | null | # Import packages
import pandas as pd
from datetime import datetime
import numpy as np
#Reading predicted data and changing date column data type
pdata = pd.read_csv('/home/pi/LABS/Asingment/Real-time-Edge-analytics/PredictionDataset.csv', skiprows=0)
pdata['Date'] = pd.to_datetime(pdata['Date'])
#Selecting data acco... | 25.809524 | 105 | 0.717712 | import pandas as pd
from datetime import datetime
import numpy as np
pdata = pd.read_csv('/home/pi/LABS/Asingment/Real-time-Edge-analytics/PredictionDataset.csv', skiprows=0)
pdata['Date'] = pd.to_datetime(pdata['Date'])
mask = (pdata['Date'] > '2013-6-1') & (pdata['Date'] < '2014-6-10')
poutput = pdata.loc[mask]
fo... | true | true |
f76cda1ff4aa7001e463eb48204bd202c13660ba | 780 | py | Python | dealer/config/dealer.py | josmeldiaz21/dealer | 16fb46db6d1b23c666fab9a8c708a9a7fd033736 | [
"MIT"
] | null | null | null | dealer/config/dealer.py | josmeldiaz21/dealer | 16fb46db6d1b23c666fab9a8c708a9a7fd033736 | [
"MIT"
] | null | null | null | dealer/config/dealer.py | josmeldiaz21/dealer | 16fb46db6d1b23c666fab9a8c708a9a7fd033736 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label":_("Dealer"),
"icon": "octicon octicon-briefcase",
"items": [
{
"type": "doctype",
"name": "Venta de Auto",
"label": _("Vent... | 25.16129 | 53 | 0.408974 | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label":_("Dealer"),
"icon": "octicon octicon-briefcase",
"items": [
{
"type": "doctype",
"name": "Venta de Auto",
"label": _("Vent... | true | true |
f76cda42554e64a9b9ed063a2759b9fca757ac69 | 58,991 | py | Python | farm/modeling/language_model.py | bvanaken/FARM | 09767092457e73860c3a604b5060562c2004f03d | [
"Apache-2.0"
] | null | null | null | farm/modeling/language_model.py | bvanaken/FARM | 09767092457e73860c3a604b5060562c2004f03d | [
"Apache-2.0"
] | null | null | null | farm/modeling/language_model.py | bvanaken/FARM | 09767092457e73860c3a604b5060562c2004f03d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors, The HuggingFace Inc. Team and deepset Team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 m... | 43.924795 | 168 | 0.658066 |
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import logging
import os
import io
from pathlib import Path
from collections import OrderedDict
from dotmap import DotMap
from tqdm import tqdm
import copy
import numpy as np
import torch
from torch import nn
logger = log... | true | true |
f76cdb4def050c2c34fcb5c3bf0f58f2bc3b657a | 1,371 | py | Python | tests/ci/unittests/rest/messages/sessionrequest_test.py | jojeya/python-sdk | da7f5caa910dfe469c29125e7476422a21a9d179 | [
"Apache-2.0"
] | null | null | null | tests/ci/unittests/rest/messages/sessionrequest_test.py | jojeya/python-sdk | da7f5caa910dfe469c29125e7476422a21a9d179 | [
"Apache-2.0"
] | null | null | null | tests/ci/unittests/rest/messages/sessionrequest_test.py | jojeya/python-sdk | da7f5caa910dfe469c29125e7476422a21a9d179 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 TestProject (https://testproject.io)
#
# 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 ... | 39.171429 | 74 | 0.730124 |
from src.testproject.helpers import ConfigHelper
from src.testproject.rest import ReportSettings
from src.testproject.rest.messages import SessionRequest
def test_sessionrequest_to_json(mocker):
mocker.patch.object(ConfigHelper, "get_sdk_version")
ConfigHelper.get_sdk_version.return_value = "1.2.3.4"
... | true | true |
f76cdb70c0240f1021005258d23db3161416d320 | 15,695 | py | Python | pandas/tests/plotting/test_boxplot_method.py | sandbox/pandas | fd5471208244ae1cb9cb426d6aa02ab408cfacba | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/tests/plotting/test_boxplot_method.py | sandbox/pandas | fd5471208244ae1cb9cb426d6aa02ab408cfacba | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/tests/plotting/test_boxplot_method.py | sandbox/pandas | fd5471208244ae1cb9cb426d6aa02ab408cfacba | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 1 | 2020-11-14T00:18:18.000Z | 2020-11-14T00:18:18.000Z | # coding: utf-8
import nose
import itertools
import string
from distutils.version import LooseVersion
from pandas import Series, DataFrame, MultiIndex
from pandas.compat import range, lzip
import pandas.util.testing as tm
from pandas.util.testing import slow
import numpy as np
from numpy import random
from numpy.ran... | 41.742021 | 79 | 0.597324 |
import nose
import itertools
import string
from distutils.version import LooseVersion
from pandas import Series, DataFrame, MultiIndex
from pandas.compat import range, lzip
import pandas.util.testing as tm
from pandas.util.testing import slow
import numpy as np
from numpy import random
from numpy.random import randn... | true | true |
f76cdcae7310aac38c26031236e0a5add4f1bdfa | 9,537 | py | Python | Izometrije-prostora/izvor/izometrije.py | matfija/Projektivna-geometrija | 1d0df7e6009dffd45ff0b892cb1d3e5a8053f5c6 | [
"MIT"
] | null | null | null | Izometrije-prostora/izvor/izometrije.py | matfija/Projektivna-geometrija | 1d0df7e6009dffd45ff0b892cb1d3e5a8053f5c6 | [
"MIT"
] | null | null | null | Izometrije-prostora/izvor/izometrije.py | matfija/Projektivna-geometrija | 1d0df7e6009dffd45ff0b892cb1d3e5a8053f5c6 | [
"MIT"
] | 1 | 2021-01-04T17:32:56.000Z | 2021-01-04T17:32:56.000Z | #!/usr/bin/env python3
# Ukljucivanje modula za matematiku
import numpy as np
import numpy.linalg as LA
# Ukljucivanje modula za upozorenja
import warnings
# NAPOMENA: svi razmatrani uglovi zadati su u radijanima,
# sto je u skladu sa uobicajenom informatickom praksom
# Matrica rotacije koja odgovara so... | 26.714286 | 66 | 0.600294 |
import numpy as np
import numpy.linalg as LA
import warnings
def Euler2A(phi, theta, psi):
if not isinstance(phi, (int, float)) or\
not isinstance(theta, (int, float)) or\
not isinstance(psi, (int, float)):
raise ValueError
Rx = np.array([[ 1, 0, 0... | true | true |
f76cdcb872317e9c045e695927ce587c96d53b61 | 2,685 | py | Python | reverse-ffmpeg.py | abhiraj2/reverse-ffmpeg | a9f0e5e79f31e1317af3b8bbed92d9111e2bfd38 | [
"MIT"
] | null | null | null | reverse-ffmpeg.py | abhiraj2/reverse-ffmpeg | a9f0e5e79f31e1317af3b8bbed92d9111e2bfd38 | [
"MIT"
] | null | null | null | reverse-ffmpeg.py | abhiraj2/reverse-ffmpeg | a9f0e5e79f31e1317af3b8bbed92d9111e2bfd38 | [
"MIT"
] | null | null | null | import os, sys, subprocess
default_dir = os.path.join(os.path.expanduser('~'), 'Videos/')
if not os.path.exists(default_dir + "test"):
os.mkdir(default_dir + "test")
else:
print("path exists\n " + default_dir + "test")
if not os.path.exists(default_dir + "test/pics"):
os.mkdir(default_dir... | 50.660377 | 213 | 0.623464 | import os, sys, subprocess
default_dir = os.path.join(os.path.expanduser('~'), 'Videos/')
if not os.path.exists(default_dir + "test"):
os.mkdir(default_dir + "test")
else:
print("path exists\n " + default_dir + "test")
if not os.path.exists(default_dir + "test/pics"):
os.mkdir(default_dir... | true | true |
f76cdd258e7a69ac592657a143ee1371d010ea5b | 411 | py | Python | 240-Search-a-2D-Matrix-II/solution.py | alfmunny/leetcode | e35d2164c7e6e66410309fe1667ceab5a7689bef | [
"MIT"
] | null | null | null | 240-Search-a-2D-Matrix-II/solution.py | alfmunny/leetcode | e35d2164c7e6e66410309fe1667ceab5a7689bef | [
"MIT"
] | null | null | null | 240-Search-a-2D-Matrix-II/solution.py | alfmunny/leetcode | e35d2164c7e6e66410309fe1667ceab5a7689bef | [
"MIT"
] | null | null | null | class Solution:
def searchMatrix(self, matrix, target):
if not matrix or not matrix[0]:
return False
i, j = 0, len(matrix[0]) - 1
while i < len(matrix) and j >= 0 :
if matrix[i][j] == target:
return True
elif matrix[i][j] > ta... | 25.6875 | 43 | 0.425791 | class Solution:
def searchMatrix(self, matrix, target):
if not matrix or not matrix[0]:
return False
i, j = 0, len(matrix[0]) - 1
while i < len(matrix) and j >= 0 :
if matrix[i][j] == target:
return True
elif matrix[i][j] > ta... | true | true |
f76cde65e5f7ebd5316e0897418b5ee8db6aa3ee | 2,574 | py | Python | openml_data_integration/protobuf_generator/openml_40680/server.py | tuix/tutorials | 733d35a8a39df079e8c2432c441b70785ab08440 | [
"Apache-2.0"
] | 8 | 2020-04-21T13:29:04.000Z | 2021-12-13T08:59:09.000Z | openml_data_integration/protobuf_generator/openml_40680/server.py | tuix/tutorials | 733d35a8a39df079e8c2432c441b70785ab08440 | [
"Apache-2.0"
] | 3 | 2021-04-27T11:03:04.000Z | 2021-05-24T18:22:57.000Z | openml_data_integration/protobuf_generator/openml_40680/server.py | tuix/tutorials | 733d35a8a39df079e8c2432c441b70785ab08440 | [
"Apache-2.0"
] | 6 | 2020-07-06T08:23:25.000Z | 2021-11-24T10:39:34.000Z | # date: 2021.07.14
# author: Raul Saavedra raul.saavedra.felipe@iais.fraunhofer.de
import grpc
from concurrent import futures
import time
import numpy
# import constant with the hardcoded openml data ID number
import myconstants
# import the generated grpc related classes for python
import model_pb2
import model_pb2... | 36.253521 | 81 | 0.57265 |
import grpc
from concurrent import futures
import time
import numpy
import myconstants
import model_pb2
import model_pb2_grpc
import openml_data_fetcher as odf
port_address = 8061
openml_obj = odf.FetchOpenMLData()
current_row = 0
class get_next_rowServicer(model_pb2_grpc.get_next_rowServicer):
def get_next_r... | true | true |
f76cde9c490dda6e733342d98fdf8b79bb932dbc | 8,383 | py | Python | docs/conf.py | BenMusch/s3qlite | a35c0ebc3fe35fffb6770e36e12e791ecd1cc250 | [
"MIT"
] | null | null | null | docs/conf.py | BenMusch/s3qlite | a35c0ebc3fe35fffb6770e36e12e791ecd1cc250 | [
"MIT"
] | 4 | 2018-02-02T04:32:46.000Z | 2018-02-05T15:16:06.000Z | docs/conf.py | BenMusch/s3qlite | a35c0ebc3fe35fffb6770e36e12e791ecd1cc250 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# s3qlite documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# aut... | 30.373188 | 76 | 0.714899 |
import sys
import os
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
import s3qlite
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u's3qlite'
copyright = u"2018, Ben Musc... | true | true |
f76ce07f7a4606080c72b39fc3d0b874dd86a445 | 55,294 | py | Python | services/core/ActuatorAgent/actuator/agent.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | 1 | 2020-05-26T01:29:50.000Z | 2020-05-26T01:29:50.000Z | services/core/ActuatorAgent/actuator/agent.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | null | null | null | services/core/ActuatorAgent/actuator/agent.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2019, Battelle Memorial Institute.
#
# 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... | 36.813582 | 103 | 0.609216 |
__docformat__ = 'reStructuredText'
import collections
import datetime
import logging
import sys
import gevent
from actuator.scheduler import ScheduleManager
from tzlocal import get_localzone
from volttron.platform.agent import utils
from volttron.platform.jsonrpc import RemoteError
from volttron.platform.messagin... | true | true |
f76ce0c8d693a0fd1ca3d6b3c537cfd755903f97 | 1,288 | py | Python | models/__init__.py | xr-Yang/CycleGAN-VAE | 951d45c5762f92efdea87a9723ed9deabd16c063 | [
"BSD-3-Clause"
] | 391 | 2019-04-01T04:57:36.000Z | 2022-03-25T08:08:57.000Z | models/__init__.py | xr-Yang/CycleGAN-VAE | 951d45c5762f92efdea87a9723ed9deabd16c063 | [
"BSD-3-Clause"
] | 79 | 2019-04-04T15:39:45.000Z | 2022-03-31T11:32:57.000Z | models/__init__.py | xr-Yang/CycleGAN-VAE | 951d45c5762f92efdea87a9723ed9deabd16c063 | [
"BSD-3-Clause"
] | 84 | 2019-03-29T08:39:59.000Z | 2022-03-17T05:47:30.000Z | import importlib
from models.base_model import BaseModel
def find_model_using_name(model_name):
# Given the option --model [modelname],
# the file "models/modelname_model.py"
# will be imported.
model_filename = "models." + model_name + "_model"
modellib = importlib.import_module(model_filename)
... | 32.2 | 150 | 0.680901 | import importlib
from models.base_model import BaseModel
def find_model_using_name(model_name):
model_filename = "models." + model_name + "_model"
modellib = importlib.import_module(model_filename)
model = None
target_model_name = model_name.replace('_', '') + 'model'
for n... | true | true |
f76ce14dafd45fc2514c6db86834a758d9359342 | 2,982 | py | Python | 2021/04/code.py | mr-bigbang/advent-of-code | 5fa0f78c70b10c66e516b21c08335e63e71d9e95 | [
"MIT"
] | null | null | null | 2021/04/code.py | mr-bigbang/advent-of-code | 5fa0f78c70b10c66e516b21c08335e63e71d9e95 | [
"MIT"
] | 2 | 2020-12-04T00:58:16.000Z | 2020-12-05T21:08:59.000Z | 2021/04/code.py | mr-bigbang/advent-of-code | 5fa0f78c70b10c66e516b21c08335e63e71d9e95 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import sys
import timeit
from typing import List, Optional, Tuple
class Board:
def __init__(self, board: Tuple[int]):
self._board = board
self._marks = [False] * 5 * 5
self._number = None
def play(self, number: int) -> None:
if... | 28.4 | 100 | 0.562039 |
import sys
import timeit
from typing import List, Optional, Tuple
class Board:
def __init__(self, board: Tuple[int]):
self._board = board
self._marks = [False] * 5 * 5
self._number = None
def play(self, number: int) -> None:
if number in self._board:
i = self._boa... | true | true |
f76ce169695b36d48b99185e099f3efcad5e17df | 5,344 | py | Python | venv/lib/python3.6/site-packages/future/backports/email/parser.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/future/backports/email/parser.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | 1 | 2021-06-01T23:32:38.000Z | 2021-06-01T23:32:38.000Z | venv/lib/python3.6/site-packages/future/backports/email/parser.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw, Thomas Wouters, Anthony Baxter
# Contact: email-sig@python.org
"""A parser of RFC 2822 and MIME email messages."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
__all__ = ["Par... | 39.294118 | 78 | 0.683383 |
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
__all__ = ["Parser", "HeaderParser", "BytesParser", "BytesHeaderParser"]
import warnings
from io import StringIO, TextIOWrapper
from future.backports.email.feedparser import FeedParser, BytesFeedParser
fro... | true | true |
f76ce17c0c32dad769b6c4b592b966059c04f103 | 2,763 | py | Python | backend.py | lberrada/the_translation_game | 7fd3b03d175bc8b225a49bb2a94f6512cbefe322 | [
"MIT"
] | 1 | 2020-05-28T06:15:02.000Z | 2020-05-28T06:15:02.000Z | backend.py | fredmnl/the_translation_game | 7fd3b03d175bc8b225a49bb2a94f6512cbefe322 | [
"MIT"
] | null | null | null | backend.py | fredmnl/the_translation_game | 7fd3b03d175bc8b225a49bb2a94f6512cbefe322 | [
"MIT"
] | null | null | null | import json
import os
import random
import numpy as np
import time
import redis
import msgpack
def read_data(filename='dict/parsed_wiki_fr2sp.json'):
db = redis.Redis(host='redis')
pack = db.get(filename)
if pack is not None:
return msgpack.unpackb(pack)
with open(filename, 'r') as f:
... | 29.393617 | 73 | 0.618169 | import json
import os
import random
import numpy as np
import time
import redis
import msgpack
def read_data(filename='dict/parsed_wiki_fr2sp.json'):
db = redis.Redis(host='redis')
pack = db.get(filename)
if pack is not None:
return msgpack.unpackb(pack)
with open(filename, 'r') as f:
... | true | true |
f76ce20b3e76bca848bc6d42832f90afd289683a | 1,450 | py | Python | plugins/aea-cli-ipfs/aea_cli_ipfs/exceptions.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | plugins/aea-cli-ipfs/aea_cli_ipfs/exceptions.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | plugins/aea-cli-ipfs/aea_cli_ipfs/exceptions.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021-2022 Valory AG
# Copyright 2018-2020 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | 29.591837 | 80 | 0.644828 |
class BaseIPFSToolException(Exception):
class RemoveError(BaseIPFSToolException):
class PinError(BaseIPFSToolException):
class PublishError(BaseIPFSToolException):
class NodeError(BaseIPFSToolException):
class DownloadError(BaseIPFSToolException):
class HashNotProvided(BaseIPFSToolException):
| true | true |
f76ce23b4676afb76ccc9e3688d1fcde7d67e59d | 5,119 | py | Python | castero/__main__.py | kyokley/castero | 6998e3cbdd722efe53fdc23bb4bb46750dad2d8d | [
"MIT"
] | null | null | null | castero/__main__.py | kyokley/castero | 6998e3cbdd722efe53fdc23bb4bb46750dad2d8d | [
"MIT"
] | null | null | null | castero/__main__.py | kyokley/castero | 6998e3cbdd722efe53fdc23bb4bb46750dad2d8d | [
"MIT"
] | null | null | null | import curses
import sys
import threading
import re
import argparse
import os
import io
import ctypes
import tempfile
from gevent import monkey
monkey.patch_all(thread=False, select=False)
import castero
from castero import helpers
from castero.config import Config
from castero.database import Database
from castero.d... | 31.795031 | 79 | 0.622583 | import curses
import sys
import threading
import re
import argparse
import os
import io
import ctypes
import tempfile
from gevent import monkey
monkey.patch_all(thread=False, select=False)
import castero
from castero import helpers
from castero.config import Config
from castero.database import Database
from castero.d... | true | true |
f76ce3c5a9f5a7faa1be12b9836087fcef7d17b6 | 3,821 | py | Python | pyro/infer/autoguide/initialization.py | ludkinm/pyro | d24c808a9d86d79c43a99990fe9e418ce5976613 | [
"Apache-2.0"
] | null | null | null | pyro/infer/autoguide/initialization.py | ludkinm/pyro | d24c808a9d86d79c43a99990fe9e418ce5976613 | [
"Apache-2.0"
] | null | null | null | pyro/infer/autoguide/initialization.py | ludkinm/pyro | d24c808a9d86d79c43a99990fe9e418ce5976613 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
r"""
The pyro.infer.autoguide.initialization module contains initialization functions for
automatic guides.
The standard interface for initialization is a function that inputs a Pyro
trace ``site`` dict and returns an appropriatel... | 33.814159 | 89 | 0.650353 |
import torch
from torch.distributions import transform_to
from pyro.distributions.torch import Independent
from pyro.distributions.torch_distribution import MaskedDistribution
from pyro.infer.util import is_validation_enabled
from pyro.poutine.messenger import Messenger
from pyro.util import torch_isnan
def _is_mul... | true | true |
f76ce3f0d91b223f16cdc3c93110f288bf125491 | 4,617 | py | Python | qa/rpc-tests/signrawtransactions.py | kazucoin/kazubyte | ce36b1ef899fe538f0417a263af4f0e3dbfd7233 | [
"MIT"
] | 1 | 2019-06-02T17:21:48.000Z | 2019-06-02T17:21:48.000Z | qa/rpc-tests/signrawtransactions.py | kazucoin/kazubyte | ce36b1ef899fe538f0417a263af4f0e3dbfd7233 | [
"MIT"
] | null | null | null | qa/rpc-tests/signrawtransactions.py | kazucoin/kazubyte | ce36b1ef899fe538f0417a263af4f0e3dbfd7233 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import KazuByteTestFramework
from test_framework.util import *
class... | 41.594595 | 120 | 0.67533 |
from test_framework.test_framework import KazuByteTestFramework
from test_framework.util import *
class SignRawTransactionsTest(KazuByteTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 1
def setup_network(self, split=False):
... | true | true |
f76ce5516a4e3be8ea75878fdfa9d85557134901 | 5,274 | py | Python | AHS/Tools/tools.py | yujunjiex/AHSSpider | be233dfef5478a56652426974a8f96500542c7c0 | [
"MIT"
] | 6 | 2019-09-30T13:13:31.000Z | 2021-09-27T00:28:17.000Z | AHS/Tools/tools.py | yujunjiex/AHSSpider | be233dfef5478a56652426974a8f96500542c7c0 | [
"MIT"
] | 2 | 2021-03-24T09:16:29.000Z | 2021-12-13T20:18:35.000Z | AHS/Tools/tools.py | yujunjiex/AHSSpider | be233dfef5478a56652426974a8f96500542c7c0 | [
"MIT"
] | 2 | 2019-11-22T03:25:17.000Z | 2021-09-27T00:28:19.000Z | # coding: UTF-8
"""
工具类
https://github.com/jhao104/proxy_pool
在使用前需配置好上面的代理ip池
并需要购买"高匿代理"以进行不间断爬取
"""
import requests
from lxml import etree
import random
from requests.exceptions import Timeout, RequestException
import time
# import chardet
user_agent_list = [
'Mozilla/5.0(compatible;MSIE9.0;W... | 34.697368 | 136 | 0.551195 | import requests
from lxml import etree
import random
from requests.exceptions import Timeout, RequestException
import time
user_agent_list = [
'Mozilla/5.0(compatible;MSIE9.0;WindowsNT6.1;Trident/5.0)',
'Mozilla/4.0(compatible;MSIE8.0;WindowsNT6.0;Trident/4.0)',
'Mozilla/4.0(compatible;MSIE7.0... | true | true |
f76ce642ed2428a41b46958f34f2b1ea52cd40f0 | 1,903 | py | Python | src_cam/track_object.py | Pecneb/RaspberryPI | da067a6b2b8cda5510d4c2562559a3adf58902ef | [
"MIT"
] | null | null | null | src_cam/track_object.py | Pecneb/RaspberryPI | da067a6b2b8cda5510d4c2562559a3adf58902ef | [
"MIT"
] | null | null | null | src_cam/track_object.py | Pecneb/RaspberryPI | da067a6b2b8cda5510d4c2562559a3adf58902ef | [
"MIT"
] | null | null | null | from typing import Match
import cv2 as cv
import numpy as np
from numpy.core.fromnumeric import ndim
'''
In this module, i will implement motion tracking with contour detection and contour drawing.
'''
def histOfObjects(objects = []) :
'''
Calculate the histograms of input objects.
'''
objHists = []
... | 32.810345 | 92 | 0.657909 | from typing import Match
import cv2 as cv
import numpy as np
from numpy.core.fromnumeric import ndim
def histOfObjects(objects = []) :
objHists = []
for obj in objects:
hsv_obj = cv.cvtColor(obj[0], cv.COLOR_BGR2HSV)
objHist = cv.calcHist([hsv_obj], [0], None, [180], [0, 180])
cv.norm... | true | true |
f76ce695c5c29206a2cfae7cc379a5c489588ed6 | 23,423 | py | Python | cargo_planning-65760/my_planning_graph.py | Prider/AI | e8c7c4f26279f73591ce1d3b73d6e157ff2ce776 | [
"MIT"
] | null | null | null | cargo_planning-65760/my_planning_graph.py | Prider/AI | e8c7c4f26279f73591ce1d3b73d6e157ff2ce776 | [
"MIT"
] | null | null | null | cargo_planning-65760/my_planning_graph.py | Prider/AI | e8c7c4f26279f73591ce1d3b73d6e157ff2ce776 | [
"MIT"
] | null | null | null | from aimacode.planning import Action
from aimacode.search import Problem
from aimacode.utils import expr
from lp_utils import decode_state
class PgNode():
"""Base class for planning graph nodes.
includes instance sets common to both types of nodes used in a planning graph
parents: the set of nodes in the ... | 44.700382 | 129 | 0.63395 | from aimacode.planning import Action
from aimacode.search import Problem
from aimacode.utils import expr
from lp_utils import decode_state
class PgNode():
def __init__(self):
self.parents = set()
self.children = set()
self.mutex = set()
def is_mutex(self, other) -> bool:
if o... | true | true |
f76ce6cb964d6e8c4382d0ccaec85276c930afe4 | 395 | py | Python | misc/file_open.py | jamochl/python_automation | 4eaf74ca43fceaa3545a1a68c1a1e54bbcf31376 | [
"MIT"
] | null | null | null | misc/file_open.py | jamochl/python_automation | 4eaf74ca43fceaa3545a1a68c1a1e54bbcf31376 | [
"MIT"
] | null | null | null | misc/file_open.py | jamochl/python_automation | 4eaf74ca43fceaa3545a1a68c1a1e54bbcf31376 | [
"MIT"
] | null | null | null | passwordFile = open('secret_pass.txt')
secretPassword = passwordFile.readline().strip()
print('Secret pass is:', secretPassword)
print('Enter your password')
typedPassword = input()
if typedPassword == secretPassword:
print('Access granted')
if typedPassword == '12345':
print('That password is one that... | 28.214286 | 80 | 0.721519 | passwordFile = open('secret_pass.txt')
secretPassword = passwordFile.readline().strip()
print('Secret pass is:', secretPassword)
print('Enter your password')
typedPassword = input()
if typedPassword == secretPassword:
print('Access granted')
if typedPassword == '12345':
print('That password is one that... | true | true |
f76ce6f7972206c1761ef9b0c5ad1b14c005f8a8 | 548 | py | Python | filters/gaussian.py | sebas095/imageFilter | 7059b7abfaceffa8f03f27947e5059e3173954d1 | [
"MIT"
] | null | null | null | filters/gaussian.py | sebas095/imageFilter | 7059b7abfaceffa8f03f27947e5059e3173954d1 | [
"MIT"
] | null | null | null | filters/gaussian.py | sebas095/imageFilter | 7059b7abfaceffa8f03f27947e5059e3173954d1 | [
"MIT"
] | null | null | null | import scipy
from scipy import ndimage
import numpy as np
import matplotlib.pyplot as plt
l = scipy.misc.ascent()
l = l[230:290, 220:320]
noisy = l + 0.4 * l.std() * np.random.random(l.shape)
gauss_denoised = ndimage.gaussian_filter(noisy, 2)
plt.subplot(121)
plt.imshow(noisy, cmap=plt.cm.gray, vmin=40, vmax=220)
pl... | 23.826087 | 63 | 0.715328 | import scipy
from scipy import ndimage
import numpy as np
import matplotlib.pyplot as plt
l = scipy.misc.ascent()
l = l[230:290, 220:320]
noisy = l + 0.4 * l.std() * np.random.random(l.shape)
gauss_denoised = ndimage.gaussian_filter(noisy, 2)
plt.subplot(121)
plt.imshow(noisy, cmap=plt.cm.gray, vmin=40, vmax=220)
pl... | true | true |
f76ce889903a7d08fc427875069811982994c224 | 1,002 | py | Python | python/cleanup/cleanup.py | nufrofedoc/lots-of-code | 5bea582b3cd890473f4365093b99fe75fe07eede | [
"MIT"
] | 1 | 2021-04-08T21:47:01.000Z | 2021-04-08T21:47:01.000Z | python/cleanup/cleanup.py | nufrofedoc/lots-of-code | 5bea582b3cd890473f4365093b99fe75fe07eede | [
"MIT"
] | null | null | null | python/cleanup/cleanup.py | nufrofedoc/lots-of-code | 5bea582b3cd890473f4365093b99fe75fe07eede | [
"MIT"
] | null | null | null | import os
import time
DAYS = 5 # Maximal age of file to stay, older will be deleted
FOLDERS = [
"G:\Musorka\HLAM"
]
TOTAL_DELETED_SIZE = 0 # Total deleted size of all files
TOTAL_DELETED_FILE = 0 # Total deleted files
TOTAL_DELETED_DIRS = 0 # Total deleted empty folders
#===========... | 32.322581 | 81 | 0.552894 | import os
import time
DAYS = 5 FOLDERS = [
"G:\Musorka\HLAM"
]
TOTAL_DELETED_SIZE = 0 TOTAL_DELETED_FILE = 0 TOTAL_DELETED_DIRS = 0
starttime = time.asctime()
for folder in FOLDERS:
delete_old_files(folder) delete_empty_dir(folder)
finishtime = time.asctime()
prin... | false | true |
f76ce89b1dbb3a0f2b8b7edee073a1c504105714 | 3,972 | py | Python | UploadDataToMongo/accidents/FullAccidentData.py | andres0sorio/AODS4AWork | 429aa737cdf459aa242f4dc4c234f2aad13b563f | [
"MIT"
] | 1 | 2021-05-30T06:38:57.000Z | 2021-05-30T06:38:57.000Z | UploadDataToMongo/accidents/FullAccidentData.py | andres0sorio/AODS4AWork | 429aa737cdf459aa242f4dc4c234f2aad13b563f | [
"MIT"
] | null | null | null | UploadDataToMongo/accidents/FullAccidentData.py | andres0sorio/AODS4AWork | 429aa737cdf459aa242f4dc4c234f2aad13b563f | [
"MIT"
] | null | null | null | from .AccidentData import AccidentData
class FullAccidentData(AccidentData):
"""Clase que describe los datos entregados por el cliente sobre accidentes viales"""
def __init__(self, information):
super().__init__()
self.client = information.client
self.client_name = information.client_... | 26.48 | 88 | 0.533484 | from .AccidentData import AccidentData
class FullAccidentData(AccidentData):
def __init__(self, information):
super().__init__()
self.client = information.client
self.client_name = information.client_name
self.client_contact = information.client_contact
self.client_phone =... | true | true |
f76ce8b7791ea63a7c09e7983803d5bce1589cc6 | 973 | py | Python | composite/utils/files.py | Skydipper/Composite | 5b44e0d773331cc586a02769d21fb7603fa4027d | [
"MIT"
] | null | null | null | composite/utils/files.py | Skydipper/Composite | 5b44e0d773331cc586a02769d21fb7603fa4027d | [
"MIT"
] | null | null | null | composite/utils/files.py | Skydipper/Composite | 5b44e0d773331cc586a02769d21fb7603fa4027d | [
"MIT"
] | null | null | null | """Utility functions"""
import json
import os
import datetime
import logging
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(PROJECT_DIR)
def load_config_json(name):
json_path = os.path.abspath(os.path.join(BASE_DIR, 'microservice')) + '/' + name + '.json'
... | 31.387097 | 94 | 0.620761 | import json
import os
import datetime
import logging
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = os.path.dirname(PROJECT_DIR)
def load_config_json(name):
json_path = os.path.abspath(os.path.join(BASE_DIR, 'microservice')) + '/' + name + '.json'
with open(json_path) as... | true | true |
f76ce90592e77c13fe9de3f7663bcd3a656db71f | 605 | py | Python | test/test_case.py | harsh-mody/DeepAPI | dc6a79ad93a2d558d2973d97d04142aa4fc1f548 | [
"MIT"
] | 3 | 2020-09-12T12:05:03.000Z | 2022-02-14T03:41:58.000Z | test/test_case.py | harsh-mody/DeepAPI | dc6a79ad93a2d558d2973d97d04142aa4fc1f548 | [
"MIT"
] | 4 | 2021-06-08T21:58:05.000Z | 2022-03-12T00:39:12.000Z | test/test_case.py | harsh-mody/DeepAPI | dc6a79ad93a2d558d2973d97d04142aa4fc1f548 | [
"MIT"
] | 2 | 2021-02-06T16:44:55.000Z | 2021-06-12T15:50:57.000Z | """
Base Test Case.
"""
import os
import tempfile
import shutil
from unittest import TestCase as BaseTestCase
from cfg.main_cfg import CFG
class TestCase(BaseTestCase):
cfg = CFG()
EXAMPLES_PATH = './test/examples'
""" Test Case Methods """
@classmethod
def setUpClass(cls):
cls.cfg.OUTP... | 18.333333 | 50 | 0.638017 |
import os
import tempfile
import shutil
from unittest import TestCase as BaseTestCase
from cfg.main_cfg import CFG
class TestCase(BaseTestCase):
cfg = CFG()
EXAMPLES_PATH = './test/examples'
@classmethod
def setUpClass(cls):
cls.cfg.OUTPUT_FOLDER = tempfile.mkdtemp()
@classmethod
d... | true | true |
f76cea3af399dfa565f5c841a4f53a4dbe5e5638 | 3,896 | py | Python | finetuning-transformer-lm/text_utils.py | take-cheeze/models | 3ded8fd062c57f20f6154cac2dd0d998181de755 | [
"MIT"
] | 112 | 2018-04-18T07:13:03.000Z | 2022-03-11T03:36:34.000Z | finetuning-transformer-lm/text_utils.py | take-cheeze/models | 3ded8fd062c57f20f6154cac2dd0d998181de755 | [
"MIT"
] | 16 | 2018-05-11T11:41:08.000Z | 2021-04-24T03:50:54.000Z | finetuning-transformer-lm/text_utils.py | take-cheeze/models | 3ded8fd062c57f20f6154cac2dd0d998181de755 | [
"MIT"
] | 45 | 2018-04-18T07:13:06.000Z | 2021-12-22T03:46:18.000Z | import re
import ftfy
import json
import spacy
from tqdm import tqdm
def get_pairs(word):
"""
Return set of symbol pairs in a word.
word is represented as tuple of symbols (symbols being variable-length strings)
"""
pairs = set()
prev_char = word[0]
for char in word[1:]:
pairs.add... | 30.920635 | 98 | 0.468429 | import re
import ftfy
import json
import spacy
from tqdm import tqdm
def get_pairs(word):
pairs = set()
prev_char = word[0]
for char in word[1:]:
pairs.add((prev_char, char))
prev_char = char
return pairs
def text_standardize(text):
text = text.replace('—', '-')
text = text.... | true | true |
f76cea97aea079779b7085cf55849571f3ec8586 | 1,686 | py | Python | QUICK_START/NODE_DEEPLABV3SEG_CUSTER/src/script/squeezeseg/imdb/__init__.py | Hqss/DINK | 5fecaa65e2f9da48eb8ac38ef709aa555fca8766 | [
"BSD-3-Clause"
] | 189 | 2019-01-16T03:05:23.000Z | 2020-09-14T14:54:16.000Z | QUICK_START/NODE_DEEPLABV3SEG_CUSTER/src/script/squeezeseg/imdb/__init__.py | jtpils/DINK | 5f6b3eaba279126f79ae6607f965311002d7451c | [
"BSD-3-Clause"
] | 3 | 2019-02-11T06:20:15.000Z | 2020-04-05T07:03:53.000Z | QUICK_START/NODE_DEEPLABV3SEG_CUSTER/src/script/squeezeseg/imdb/__init__.py | jtpils/DINK | 5f6b3eaba279126f79ae6607f965311002d7451c | [
"BSD-3-Clause"
] | 25 | 2019-01-16T03:05:24.000Z | 2020-04-04T21:07:53.000Z | # BSD 3-Clause License
#
# Copyright (c) 2019, FPAI
# Copyright (c) 2019, SeriouslyHAO
# Copyright (c) 2019, xcj2019
# Copyright (c) 2019, Leonfirst
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are... | 48.171429 | 80 | 0.776394 | from kitti import kitti
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.