hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1cc2ecac99db98f15aeb6f486d50924b74de5048 | 39 | py | Python | glitch_this/__init__.py | ojensen5115/glitch-this | 3432cae402a16e7f76fb218c163f4dc511cb2fdd | [
"MIT"
] | 1,674 | 2020-02-21T16:08:39.000Z | 2022-03-31T17:43:53.000Z | glitch_this/__init__.py | Issayev-Nursultan/glitch-this | af035fafc511c078e2424b2a3afe02db30e75566 | [
"MIT"
] | 29 | 2020-02-22T16:27:44.000Z | 2022-03-21T09:19:54.000Z | glitch_this/__init__.py | Issayev-Nursultan/glitch-this | af035fafc511c078e2424b2a3afe02db30e75566 | [
"MIT"
] | 63 | 2020-02-22T14:52:03.000Z | 2022-03-28T14:18:23.000Z | from .glitch_this import ImageGlitcher
| 19.5 | 38 | 0.871795 |
1cc2ee1723ab97fd0e4b3f7f3511fdb4b3a45597 | 1,172 | py | Python | aurora/bag_transfer/middleware.py | DLynch-Technology/aurora | 92f4b61ae0cdaf6f7c5a35bbdfb68e5ee91f8c96 | [
"MIT"
] | null | null | null | aurora/bag_transfer/middleware.py | DLynch-Technology/aurora | 92f4b61ae0cdaf6f7c5a35bbdfb68e5ee91f8c96 | [
"MIT"
] | null | null | null | aurora/bag_transfer/middleware.py | DLynch-Technology/aurora | 92f4b61ae0cdaf6f7c5a35bbdfb68e5ee91f8c96 | [
"MIT"
] | null | null | null | from django.utils.deprecation import MiddlewareMixin
from django.utils.functional import SimpleLazyObject
from django.contrib.auth.middleware import get_user
from rest_framework.request import Request
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
def get_user_jwt(request):
user = get_u... | 34.470588 | 114 | 0.735495 |
1cc33b049dcde24dd46271d93a10e2a2867e7327 | 9,807 | py | Python | audio_receiver_remover.py | FlorianLudwig/Disfluency-Removal-API | 5ee73226bfbd48af3f5b983cf1a43271a2e922bd | [
"MIT"
] | 13 | 2020-01-07T07:43:04.000Z | 2022-03-30T11:18:45.000Z | audio_receiver_remover.py | FlorianLudwig/Disfluency-Removal-API | 5ee73226bfbd48af3f5b983cf1a43271a2e922bd | [
"MIT"
] | null | null | null | audio_receiver_remover.py | FlorianLudwig/Disfluency-Removal-API | 5ee73226bfbd48af3f5b983cf1a43271a2e922bd | [
"MIT"
] | 4 | 2020-02-23T17:41:20.000Z | 2021-08-15T18:13:30.000Z | '''
This file serves as the api to receive
the file from the user-end as http request
sends the segmentation results as http response.
'''
import os
import web
import random
import json
import wave
import umm_seg
import numpy as np
import silence_classf
import csv
import librosa
# the full path to cur... | 34.170732 | 133 | 0.702355 |
1cc353716043f1dd086d1d1d4a2e289d3aefb01e | 1,221 | py | Python | tests/test_sampling/test_fastgsss.py | bwdeng20/thgsp | 785b3ff291d72ee51e51e4cdbfd4bab63f8de9ac | [
"BSD-3-Clause"
] | 22 | 2021-01-13T05:15:38.000Z | 2022-01-17T01:37:29.000Z | tests/test_sampling/test_fastgsss.py | bwdeng20/thgsp | 785b3ff291d72ee51e51e4cdbfd4bab63f8de9ac | [
"BSD-3-Clause"
] | 2 | 2021-03-26T04:36:39.000Z | 2022-01-11T16:17:56.000Z | tests/test_sampling/test_fastgsss.py | bwdeng20/thgsp | 785b3ff291d72ee51e51e4cdbfd4bab63f8de9ac | [
"BSD-3-Clause"
] | 2 | 2021-01-13T05:15:43.000Z | 2022-01-01T12:51:32.000Z | import pytest
import torch
import math
from thgsp.graphs.generators import random_graph
from ..utils4t import devices, float_dtypes, snr_and_mse
from thgsp.sampling.fastgsss import fastgsss, recon_fastssss
@pytest.mark.parametrize("device", devices)
@pytest.mark.parametrize("dtype", float_dtypes)
@pytest.mark.paramet... | 31.307692 | 92 | 0.613432 |
1cc382e426239f78bc740cc7227300eac25eb985 | 14,429 | py | Python | smart_open/s3.py | mbertrand/smart_open | d9b9f5ce753be5d6fd7dce578e996f8d56e385aa | [
"MIT"
] | 3 | 2018-11-27T06:30:23.000Z | 2021-05-30T15:56:32.000Z | smart_open/s3.py | mbertrand/smart_open | d9b9f5ce753be5d6fd7dce578e996f8d56e385aa | [
"MIT"
] | 1 | 2018-11-15T02:00:31.000Z | 2021-12-06T02:20:32.000Z | smart_open/s3.py | mbertrand/smart_open | d9b9f5ce753be5d6fd7dce578e996f8d56e385aa | [
"MIT"
] | 1 | 2018-04-04T12:38:47.000Z | 2018-04-04T12:38:47.000Z | # -*- coding: utf-8 -*-
"""Implements file-like objects for reading and writing from/to S3."""
import boto3
import botocore.client
import io
import logging
import six
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
START = 0
CURRENT = 1
END = 2
WHENCE_CHOICES = (START, CURRENT, END)
... | 32.064444 | 119 | 0.605932 |
1cc3bdef10181e26a4355cd1ceec95a8e6dfd39f | 843 | py | Python | day12/day12_part2.py | Disi77/AdventOfCode2020 | aafe1b402e08976c2cade3c044ead811b67bcf71 | [
"WTFPL"
] | 1 | 2020-12-05T12:39:03.000Z | 2020-12-05T12:39:03.000Z | day12/day12_part2.py | Disi77/AdventOfCode2020 | aafe1b402e08976c2cade3c044ead811b67bcf71 | [
"WTFPL"
] | null | null | null | day12/day12_part2.py | Disi77/AdventOfCode2020 | aafe1b402e08976c2cade3c044ead811b67bcf71 | [
"WTFPL"
] | null | null | null | with open("day12_input.txt", encoding="utf-8", mode="r") as f:
input_data = f.readlines()
waypoint = [10, 1]
ship = [0, 0]
for item in input_data:
action, value = item[0], int(item[1:])
if action == "F":
ship[0] += value * waypoint[0]
ship[1] += value * waypoint[1]
elif action == "N":
... | 27.193548 | 62 | 0.495848 |
1cc3d14b99e3e1092ac88b9579fc364c971813d8 | 3,359 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.397059 | 172 | 0.70646 |
1cc3f3a29647592863ccfc00254a926e7700440e | 7,598 | py | Python | dl_markup/BrushTool.py | shorohml/dl_markup | 7cdd2970bd0e6a2a3d40b098bd20f395bdf1b4ce | [
"MIT"
] | null | null | null | dl_markup/BrushTool.py | shorohml/dl_markup | 7cdd2970bd0e6a2a3d40b098bd20f395bdf1b4ce | [
"MIT"
] | null | null | null | dl_markup/BrushTool.py | shorohml/dl_markup | 7cdd2970bd0e6a2a3d40b098bd20f395bdf1b4ce | [
"MIT"
] | null | null | null | from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QCursor, QPixmap, QPainter
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .Canvas import Canvas
class CylinderItem(QtWidgets.QGraphicsItem):
"""Drawing item that represents basic brush movement.
Conta... | 32.331915 | 79 | 0.574625 |
1cc4177b65d552e4b3ce6a02265b7eb6c08d69df | 28,831 | py | Python | scipy/weave/catalog.py | disqus/scipy | 2619f0ca030b2bcf630ddd9a33f48c588cf4fcea | [
"BSD-3-Clause"
] | null | null | null | scipy/weave/catalog.py | disqus/scipy | 2619f0ca030b2bcf630ddd9a33f48c588cf4fcea | [
"BSD-3-Clause"
] | null | null | null | scipy/weave/catalog.py | disqus/scipy | 2619f0ca030b2bcf630ddd9a33f48c588cf4fcea | [
"BSD-3-Clause"
] | null | null | null | """ Track relationships between compiled extension functions & code fragments
catalog keeps track of which compiled(or even standard) functions are
related to which code fragments. It also stores these relationships
to disk so they are remembered between Python sessions. When
a = 1
compi... | 40.043056 | 82 | 0.625473 |
1cc43a998c64334daee35bc78f618a8d72a9b5e4 | 413 | py | Python | drink_flow_control/wsgi.py | jeffersonkr/drink_flow_control | 7dc6d97bce6110b34d309fa61079385e6f3efde5 | [
"MIT"
] | null | null | null | drink_flow_control/wsgi.py | jeffersonkr/drink_flow_control | 7dc6d97bce6110b34d309fa61079385e6f3efde5 | [
"MIT"
] | 1 | 2022-02-10T08:42:42.000Z | 2022-02-10T08:42:42.000Z | drink_flow_control/wsgi.py | jeffersonkr/drink_flow_control | 7dc6d97bce6110b34d309fa61079385e6f3efde5 | [
"MIT"
] | null | null | null | """
WSGI config for drink_flow_control project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("D... | 24.294118 | 78 | 0.79661 |
1cc43c4e367fe02401fc3ad99934230922e26c71 | 759 | py | Python | tests/mmm/scripts/midolman/api/api.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | 1 | 2015-05-19T08:36:55.000Z | 2015-05-19T08:36:55.000Z | tests/mmm/scripts/midolman/api/api.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | tests/mmm/scripts/midolman/api/api.py | duarten/midonet | c7a5aa352a8038bdc6a463c68abc47bb411a1e7c | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Midokura SARL
#
# 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... | 34.5 | 74 | 0.747036 |
1cc47b544fb50dd18b8e85da0b87d81807d0fe8f | 881 | py | Python | semesterpage/migrations/0023_auto_20170809_2327.py | JakobGM/WikiLinks | 5743b1d4c3fefa66fcaa4d283436d2a3f0490604 | [
"MIT"
] | 6 | 2017-08-12T09:55:06.000Z | 2019-09-03T08:05:21.000Z | semesterpage/migrations/0023_auto_20170809_2327.py | JakobGM/WikiLinks | 5743b1d4c3fefa66fcaa4d283436d2a3f0490604 | [
"MIT"
] | 57 | 2017-08-11T23:05:07.000Z | 2022-03-11T23:32:12.000Z | semesterpage/migrations/0023_auto_20170809_2327.py | JakobGM/WikiLinks | 5743b1d4c3fefa66fcaa4d283436d2a3f0490604 | [
"MIT"
] | 1 | 2017-09-27T15:31:15.000Z | 2017-09-27T15:31:15.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-09 21:27
from __future__ import unicode_literals
import autoslug.fields
from django.db import migrations
import semesterpage.models
class Migration(migrations.Migration):
dependencies = [
('semesterpage', '0022_semester_has_electives'),
... | 31.464286 | 169 | 0.681044 |
1cc48898392502be8ceacbfa0e879a560c6f8c4d | 3,971 | py | Python | utils.py | theoziyu/crawler_turbosquid | 5626d2ef2c2d0dd9a3691ab13080fa5a02882689 | [
"CC0-1.0"
] | null | null | null | utils.py | theoziyu/crawler_turbosquid | 5626d2ef2c2d0dd9a3691ab13080fa5a02882689 | [
"CC0-1.0"
] | null | null | null | utils.py | theoziyu/crawler_turbosquid | 5626d2ef2c2d0dd9a3691ab13080fa5a02882689 | [
"CC0-1.0"
] | null | null | null | import urllib.request
import os
class Utils:
"""Utils is a class for utility functions to change and get names of
urls. It also has a function to check if a directory exists and create
one if it does not exist.
"""
def __init__(self):
try:
print("Started creation of object type... | 39.71 | 74 | 0.564845 |
1cc4a6c8bdc19d49c720166f1758e29f71c12d06 | 8,948 | py | Python | classifiers/logisticRegression.py | gionanide/Speech-Signal-Processing-and-Classification | eff023fd491697a89cdb0491393d2e9600b65895 | [
"MIT"
] | 203 | 2018-03-20T13:39:52.000Z | 2022-03-24T07:52:31.000Z | classifiers/logisticRegression.py | gionanide/Speech-Signal-Processing-and-Classification | eff023fd491697a89cdb0491393d2e9600b65895 | [
"MIT"
] | 3 | 2019-01-15T07:39:02.000Z | 2021-06-07T11:29:34.000Z | classifiers/logisticRegression.py | gionanide/Speech-Signal-Processing-and-Classification | eff023fd491697a89cdb0491393d2e9600b65895 | [
"MIT"
] | 68 | 2018-05-03T06:40:38.000Z | 2022-02-13T04:30:57.000Z | #!usr/bin/python
from __future__ import division
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy as sk
from sklearn.feature_selection import RFE
import matplotlib.patches as mpatches
from sklearn.metrics import confusion_matrix, roc_curve, roc_auc_score
from pandas.tools.plotting imp... | 39.59292 | 166 | 0.763858 |
1cc4b8d367015c29717cf1db106055a31d82c96d | 43,528 | py | Python | dipper/sources/OMIM.py | sgml/dipper | cff0d01299e982183a5345b8a7eb00094ed05257 | [
"BSD-3-Clause"
] | null | null | null | dipper/sources/OMIM.py | sgml/dipper | cff0d01299e982183a5345b8a7eb00094ed05257 | [
"BSD-3-Clause"
] | null | null | null | dipper/sources/OMIM.py | sgml/dipper | cff0d01299e982183a5345b8a7eb00094ed05257 | [
"BSD-3-Clause"
] | null | null | null | import logging
import re
import json
import urllib
from urllib.error import HTTPError
from datetime import date
from dipper.sources.OMIMSource import OMIMSource, USER_AGENT
from dipper.models.Model import Model
from dipper.models.assoc.G2PAssoc import G2PAssoc
from dipper.models.Genotype import Genotype
from dipper.mo... | 42.260194 | 88 | 0.539032 |
1cc4be2c49e2e3c2bd8a30061063e663a182f2b7 | 1,263 | py | Python | discord.py-async/discord/__init__.py | SporadicToast/yukino-bot | 80e1be96341d628490738e5c9a3a7b91043ed441 | [
"MIT"
] | null | null | null | discord.py-async/discord/__init__.py | SporadicToast/yukino-bot | 80e1be96341d628490738e5c9a3a7b91043ed441 | [
"MIT"
] | null | null | null | discord.py-async/discord/__init__.py | SporadicToast/yukino-bot | 80e1be96341d628490738e5c9a3a7b91043ed441 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Discord API Wrapper
~~~~~~~~~~~~~~~~~~~
A basic wrapper for the Discord API.
:copyright: (c) 2015-2016 Rapptz
:license: MIT, see LICENSE for more details.
"""
__title__ = 'discord'
__author__ = 'Rapptz'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015-2016 Rapptz'
__version__ = '0.10... | 24.288462 | 86 | 0.748219 |
1cc4dda40be9bd102de1f79935980748d80c90bd | 2,275 | py | Python | simresult.py | deshpandeyash/treesplittingsimulator | aa93dcac892cd580669e453353a88a7b9343b423 | [
"MIT"
] | 1 | 2020-02-20T15:00:14.000Z | 2020-02-20T15:00:14.000Z | simresult.py | deshpandeyash/treesplittingsimulator | aa93dcac892cd580669e453353a88a7b9343b423 | [
"MIT"
] | null | null | null | simresult.py | deshpandeyash/treesplittingsimulator | aa93dcac892cd580669e453353a88a7b9343b423 | [
"MIT"
] | null | null | null | import numpy as np
class SimResult(object):
def __init__(self):
self.throughput = 0
self.mean_packet_delay = 0
self.max_packet_delay = 0
self.mean_no_tx = 0
self.max_no_tx = 0
self.succ_rate = 0
self.no_trees = 0
self.idle_rate = 0
... | 38.559322 | 116 | 0.636923 |
1cc4e34a5b0947df72969395d1f8fad4e609a4de | 14,524 | py | Python | pyrseas/testutils.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | 1 | 2015-03-16T09:10:47.000Z | 2015-03-16T09:10:47.000Z | pyrseas/testutils.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | null | null | null | pyrseas/testutils.py | andreypopp/Pyrseas | 5fadc91bfd1e3e430e8f53d434df18b9abea3cb0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Utility functions and classes for testing Pyrseas"""
import os
from unittest import TestCase
from psycopg2 import connect
from psycopg2.extras import DictConnection
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
from pyrseas.database import Database
def fix_indent(stmt):
... | 35.42439 | 79 | 0.55997 |
1cc5037ba63d0ee46441c53885fee7dd26944643 | 284 | py | Python | policies/named_policies/AdamV3.py | TeamJumpstart/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 10 | 2021-04-18T17:54:02.000Z | 2021-07-26T19:58:41.000Z | policies/named_policies/AdamV3.py | DiddiZ/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 1 | 2021-04-21T15:13:41.000Z | 2021-04-21T15:13:41.000Z | policies/named_policies/AdamV3.py | DiddiZ/InformatiCup2021 | a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4 | [
"MIT"
] | 1 | 2021-04-20T09:42:50.000Z | 2021-04-20T09:42:50.000Z | from heuristics import CompositeHeuristic, PathLengthHeuristic, RegionHeuristic
from policies import HeuristicPolicy
pol = HeuristicPolicy(
CompositeHeuristic([
PathLengthHeuristic(20),
RegionHeuristic(),
], weights=[20, 1]), occupancy_map_depth=3
)
| 28.4 | 80 | 0.728873 |
1cc50d74c2e8ef0607deb5a404e9f8f26941e72d | 3,989 | py | Python | experiments/vitchyr/probabilistic_goal_reaching/basic_reaching_with_dynamics_visualization/exp_6_flat_wall_longer_horizons_fixed_opt_discount.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/vitchyr/probabilistic_goal_reaching/basic_reaching_with_dynamics_visualization/exp_6_flat_wall_longer_horizons_fixed_opt_discount.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/vitchyr/probabilistic_goal_reaching/basic_reaching_with_dynamics_visualization/exp_6_flat_wall_longer_horizons_fixed_opt_discount.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.experiments.vitchyr.probabilistic_goal_reaching.launcher import \
probabilistic_goal_reaching_experiment
from rlkit.launchers.launcher_util import run_experiment
if __name__ == "__main__":
variant = dict(
qf_kwargs=dict(
hidden_si... | 30.922481 | 86 | 0.547506 |
1cc52359e90ac003014de22b0aa37066190db248 | 682 | py | Python | bridger/serializers/fields/primary_key.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 2 | 2020-03-17T00:53:23.000Z | 2020-07-16T07:00:33.000Z | bridger/serializers/fields/primary_key.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 76 | 2019-12-05T01:15:57.000Z | 2021-09-07T16:47:27.000Z | bridger/serializers/fields/primary_key.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 1 | 2020-02-05T15:09:47.000Z | 2020-02-05T15:09:47.000Z | from rest_framework import serializers
from .mixins import BridgerSerializerFieldMixin
from .types import BridgerType
class PrimaryKeyField(BridgerSerializerFieldMixin, serializers.IntegerField):
field_type = BridgerType.PRIMARY_KEY.value
def __init__(self, *args, **kwargs):
kwargs["read_only"] = Tr... | 29.652174 | 78 | 0.719941 |
1cc5267afbf2b58c79c41248c434c7040f6b0362 | 8,929 | py | Python | content/test/gpu/gpu_tests/gpu_test_expectations_unittest.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | content/test/gpu/gpu_tests/gpu_test_expectations_unittest.py | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | content/test/gpu/gpu_tests/gpu_test_expectations_unittest.py | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright 2015 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.
import unittest
from telemetry.internal.platform import system_info
from telemetry.page import page as page_module
from telemetry.story import story_set
fro... | 44.422886 | 80 | 0.676224 |
1cc52d2b6e2445d7f4451f7d3479ecf9988aa8d7 | 1,699 | py | Python | nlptools/zoo/demodata/demo_seq.py | zhupengjia/nlptools | a0afc4873ee1b3adb383d38075ad5ae5e0293055 | [
"MIT"
] | 1 | 2020-10-26T02:32:25.000Z | 2020-10-26T02:32:25.000Z | nlptools/zoo/demodata/demo_seq.py | zhupengjia/nlptools | a0afc4873ee1b3adb383d38075ad5ae5e0293055 | [
"MIT"
] | null | null | null | nlptools/zoo/demodata/demo_seq.py | zhupengjia/nlptools | a0afc4873ee1b3adb383d38075ad5ae5e0293055 | [
"MIT"
] | 1 | 2020-10-26T02:34:05.000Z | 2020-10-26T02:34:05.000Z | #!/usr/bin/env python
import numpy
from nlptools.text import Vocab
def demo_seq():
training_data = [('what is the illuminati'.split(), 'a world wide conspiracy'.split()),
('what is the illuminatti'.split(), 'a secret society that has supposedly existed for centuries'.split()),
('what is v... | 44.710526 | 135 | 0.652148 |
1cc533b0aa6f80d450e0246e15051219b4add8e6 | 19,244 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2021_06_01_preview/aio/operations/_import_pipelines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2021_06_01_preview/aio/operations/_import_pipelines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2021_06_01_preview/aio/operations/_import_pipelines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.483092 | 225 | 0.679433 |
1cc53b82bec6009262585d657d9f7b721d639b28 | 3,850 | py | Python | models/cifar10_wresnet.py | Tabrizian/learning-to-quantize | 545ef7075ff01cbb218600878943554954cef53f | [
"Apache-2.0"
] | 16 | 2020-10-16T16:21:50.000Z | 2021-12-15T06:45:12.000Z | models/cifar10_wresnet.py | Tabrizian/learning-to-quantize | 545ef7075ff01cbb218600878943554954cef53f | [
"Apache-2.0"
] | null | null | null | models/cifar10_wresnet.py | Tabrizian/learning-to-quantize | 545ef7075ff01cbb218600878943554954cef53f | [
"Apache-2.0"
] | 4 | 2020-10-27T12:32:28.000Z | 2021-04-25T04:43:45.000Z | # https://github.com/xternalz/WideResNet-pytorch/blob/master/wideresnet.py
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride, dropRate=0.0):
super(BasicBlock, self).__init__()
self.bn1 = nn.B... | 44.252874 | 116 | 0.605455 |
1cc54af8943b4651804acb76bbb818d3ff0514af | 2,013 | py | Python | sandbox/dead_code/resolver-dot-generator/util2.py | pombreda/pkgcore | b438fc573af1a031d7ce12adbbf299bab5338451 | [
"BSD-3-Clause"
] | 1 | 2021-07-05T13:10:18.000Z | 2021-07-05T13:10:18.000Z | sandbox/dead_code/resolver-dot-generator/util2.py | vapier/pkgcore | 35a7e4f4f0fc61dd9c4dc72d35a57e2e9d5b832f | [
"BSD-3-Clause"
] | 8 | 2015-03-24T14:21:44.000Z | 2015-03-24T14:21:44.000Z | sandbox/dead_code/resolver-dot-generator/util2.py | vapier/pkgcore | 35a7e4f4f0fc61dd9c4dc72d35a57e2e9d5b832f | [
"BSD-3-Clause"
] | null | null | null | # Copyright: 2006 Brian Harring <ferringb@gmail.com>
# License: GPL2/BSD
def mangle_name(arg):
return '"%s"' % str(arg).replace('"', '\\"')
def dump_edge(parent, child, text):
return "%s->%s [label=%s];" % (mangle_name(parent), mangle_name(child), mangle_name(text))
def dump_package_dep(parent, atom):
return "%s-... | 32.467742 | 100 | 0.658222 |
1cc54ff1efbb36eec27c09a704742b31dc3adf64 | 8,280 | py | Python | hasher-matcher-actioner/hmalib/matchers/matchers_base.py | LaudateCorpus1/ThreatExchange | d25ccb0070ef0e7c72a1909610c9bc31a79d6bfc | [
"BSD-3-Clause"
] | null | null | null | hasher-matcher-actioner/hmalib/matchers/matchers_base.py | LaudateCorpus1/ThreatExchange | d25ccb0070ef0e7c72a1909610c9bc31a79d6bfc | [
"BSD-3-Clause"
] | 3 | 2021-08-21T07:49:33.000Z | 2022-03-12T01:03:31.000Z | hasher-matcher-actioner/hmalib/matchers/matchers_base.py | LaudateCorpus1/ThreatExchange | d25ccb0070ef0e7c72a1909610c9bc31a79d6bfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Implements a unified matcher class. The unified matcher is capable of matching
against any index defined in python-threatexchange.
"""
import datetime
import functools
from mypy_boto3_sns.client import SNSClient
from hmalib.common.signal_mode... | 34.5 | 88 | 0.650242 |
1cc5517a110943b697c3b9c8d0fd60521cbcb714 | 45,611 | py | Python | nmtwizard/framework.py | ClementChouteau/nmt-wizard-docker | b2bf2178b48ee1decd4a7216eee358b8e0953ce8 | [
"MIT"
] | null | null | null | nmtwizard/framework.py | ClementChouteau/nmt-wizard-docker | b2bf2178b48ee1decd4a7216eee358b8e0953ce8 | [
"MIT"
] | null | null | null | nmtwizard/framework.py | ClementChouteau/nmt-wizard-docker | b2bf2178b48ee1decd4a7216eee358b8e0953ce8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Shared logic and abstractions of frameworks."""
import os
import abc
import copy
import json
import time
import filecmp
import re
import six
import gzip
import shutil
import collections
import traceback
from nmtwizard.logger import get_logger
from nmtwizard import config as config_util
from... | 43.151372 | 108 | 0.585166 |
1cc55bf4d5391b8cc5a14bca43d2eb74d04651e7 | 1,565 | py | Python | metrics-pusher/src/bai_metrics_pusher/__main__.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 6 | 2020-09-29T09:03:04.000Z | 2022-03-14T06:52:25.000Z | metrics-pusher/src/bai_metrics_pusher/__main__.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | null | null | null | metrics-pusher/src/bai_metrics_pusher/__main__.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 4 | 2020-10-01T07:49:22.000Z | 2021-06-16T19:44:12.000Z | #!/usr/bin/env python
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENS... | 31.938776 | 113 | 0.725879 |
1cc56a6ac2e556da2acc3a9f41e4d57fba6f7299 | 759 | py | Python | dj_audit/admin.py | Fattyk/django-audit | f89059fb0d8e8dbe15b95d11a63e050fcde9e8ef | [
"Apache-2.0"
] | null | null | null | dj_audit/admin.py | Fattyk/django-audit | f89059fb0d8e8dbe15b95d11a63e050fcde9e8ef | [
"Apache-2.0"
] | null | null | null | dj_audit/admin.py | Fattyk/django-audit | f89059fb0d8e8dbe15b95d11a63e050fcde9e8ef | [
"Apache-2.0"
] | null | null | null | from django.contrib.admin import DateFieldListFilter, ModelAdmin, register
from dj_audit.models import AuditLog
@register(AuditLog)
class AuditLogAdmin(ModelAdmin):
list_display = (
'user_agent', 'ip_address', 'user', 'content_type', 'query_string',
'http_method', 'http_referer', 'path_info', 're... | 36.142857 | 118 | 0.693017 |
1cc570bea743f5fcb0b317c197fb047db93e42c1 | 969 | py | Python | Socket_programming/03_script.py | udhayprakash/python_for_security | 5db5d3efdd8349e94f89b176d0f8651c4a9a1136 | [
"Apache-2.0"
] | null | null | null | Socket_programming/03_script.py | udhayprakash/python_for_security | 5db5d3efdd8349e94f89b176d0f8651c4a9a1136 | [
"Apache-2.0"
] | null | null | null | Socket_programming/03_script.py | udhayprakash/python_for_security | 5db5d3efdd8349e94f89b176d0f8651c4a9a1136 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# third.py
import socket
import sys
# host = 'localhost'
host = raw_input("Enter the host name to connect(ex: www.google.com) : ")
port = int(raw_input("Enter the port to connect (ex: 80) : "))
# creating a socket
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error, er... | 23.634146 | 100 | 0.653251 |
1cc59ca62a676eb9ab6badb7794f0b4f9d70b8dd | 5,336 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 38.948905 | 133 | 0.659483 |
1cc5b7a199eb86e110b170799dbd40d264ba7691 | 1,428 | py | Python | alipay/aop/api/domain/AlipayOpenMiniVersionGrayCancelModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayOpenMiniVersionGrayCancelModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayOpenMiniVersionGrayCancelModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenMiniVersionGrayCancelModel(object):
def __init__(self):
self._app_version = None
self._bundle_id = None
@property
def app_version(self):
return self._ap... | 25.5 | 73 | 0.60084 |
1cc5c07e39ad90a4a3842cf1f8e5a0726c0ae8ca | 7,472 | py | Python | gammapy/estimators/utils.py | isu-veritas/gammapy | 715b041d7d3925bd51109dc9534634263a2f2d12 | [
"BSD-3-Clause"
] | null | null | null | gammapy/estimators/utils.py | isu-veritas/gammapy | 715b041d7d3925bd51109dc9534634263a2f2d12 | [
"BSD-3-Clause"
] | null | null | null | gammapy/estimators/utils.py | isu-veritas/gammapy | 715b041d7d3925bd51109dc9534634263a2f2d12 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import scipy.ndimage
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.table import Table
from gammapy.datasets import SpectrumDataset, SpectrumDatasetOnOff
from gammapy.datasets.map import MapEvaluator... | 33.208889 | 104 | 0.663142 |
1cc5d520fc4743614728c5a31526004ccaca4719 | 1,501 | py | Python | setup.py | Stimson-Center/stimson-web-scraper | c2e6c3ae4abb8e8697b10d844bfb0fa3d305d05f | [
"MIT"
] | 1 | 2020-09-11T01:13:27.000Z | 2020-09-11T01:13:27.000Z | setup.py | Stimson-Center/stimson-web-scraper | c2e6c3ae4abb8e8697b10d844bfb0fa3d305d05f | [
"MIT"
] | 15 | 2020-06-19T01:14:36.000Z | 2021-09-08T02:00:20.000Z | setup.py | Stimson-Center/stimson-web-scraper | c2e6c3ae4abb8e8697b10d844bfb0fa3d305d05f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alan S. Cooper
https://packaging.python.org/tutorials/packaging-projects/
"""
import os
import sys
import setuptools
from scraper import __version__
if sys.argv[-1] == "publish":
# PYPI now uses twine for package management.
# For this to work you must first... | 27.290909 | 74 | 0.668887 |
1cc5d5a13d7d64f91679df1b25c8b9c5469f4f5f | 3,043 | py | Python | VAE/train.py | Ali-Sahili/Background-Subtraction-Unsupervised-Learning | 445b2cf8736a4a28cff2b074a32afe8fe6986d53 | [
"MIT"
] | 5 | 2021-05-17T06:52:28.000Z | 2022-02-20T15:35:51.000Z | VAE/train.py | WN1695173791/Background-Subtraction-Unsupervised-Learning | 445b2cf8736a4a28cff2b074a32afe8fe6986d53 | [
"MIT"
] | null | null | null | VAE/train.py | WN1695173791/Background-Subtraction-Unsupervised-Learning | 445b2cf8736a4a28cff2b074a32afe8fe6986d53 | [
"MIT"
] | 1 | 2021-05-17T06:52:33.000Z | 2021-05-17T06:52:33.000Z | import torch
from torch.autograd import Variable
import torchvision.utils as vutils
from VAE.model import VAE, Encoder, Decoder, VAE256
import os
path = os.getcwd()
os.chdir("../")
from Param import *
os.chdir(path)
from VAE.Loss_functions import *
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
... | 28.175926 | 108 | 0.562931 |
1cc5e1cdf6ee4c8fa280822b6b4cd359cffa8e0c | 4,003 | py | Python | alipay/aop/api/request/AlipayEbppInstserviceDeductConfirmRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayEbppInstserviceDeductConfirmRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayEbppInstserviceDeductConfirmRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayEbppInstserviceDeductConfirmModel import AlipayEbppInstserviceDeductConfirmModel
class AlipayEbppInstserviceDeductConfirmReque... | 27.606897 | 148 | 0.647514 |
1cc5fbe35b90f6a57211d8b5143aa0e225c3e26c | 952 | py | Python | datacube/__init__.py | Kirill888/datacube-core | 996b395e15f975decb77c0ca9fa0555177674b2f | [
"Apache-2.0"
] | 1 | 2020-04-15T16:10:27.000Z | 2020-04-15T16:10:27.000Z | datacube/__init__.py | Kirill888/datacube-core | 996b395e15f975decb77c0ca9fa0555177674b2f | [
"Apache-2.0"
] | null | null | null | datacube/__init__.py | Kirill888/datacube-core | 996b395e15f975decb77c0ca9fa0555177674b2f | [
"Apache-2.0"
] | null | null | null | """
Datacube
========
Provides access to multi-dimensional data, with a focus on Earth observations data such as LANDSAT.
To use this module, see the `Developer Guide <http://datacube-core.readthedocs.io/en/stable/dev/developer.html>`_.
The main class to access the datacube is :class:`datacube.Datacube`.
To initial... | 25.72973 | 114 | 0.747899 |
1cc626366f8116a3334f66938e5e7b17f3537d13 | 6,288 | py | Python | src/scripts/bench.py | clayne/botan | 1f16adea08c4c9bf3fb0fbf699d284cb48150898 | [
"BSD-2-Clause"
] | 1,988 | 2015-01-04T02:58:16.000Z | 2022-03-31T18:03:37.000Z | src/scripts/bench.py | evpo/botan | 6f8a696962c3aa605e9e5a53710c96dcb8477c9f | [
"BSD-2-Clause"
] | 2,455 | 2015-01-04T17:53:39.000Z | 2022-03-30T18:15:31.000Z | src/scripts/bench.py | evpo/botan | 6f8a696962c3aa605e9e5a53710c96dcb8477c9f | [
"BSD-2-Clause"
] | 590 | 2015-01-07T04:05:12.000Z | 2022-03-30T20:42:05.000Z | #!/usr/bin/python
"""
Compare Botan with OpenSSL using their respective benchmark utils
(C) 2017 Jack Lloyd
Botan is released under the Simplified BSD License (see license.txt)
TODO
- Also compare RSA, ECDSA, ECDH
- Output pretty graphs with matplotlib
"""
import logging
import os
import sys
import optparse # py... | 28.976959 | 92 | 0.605598 |
1cc67a302fa2129385fba4f93204ba19095f6ed8 | 2,812 | py | Python | datastructures/trees/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | datastructures/trees/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | datastructures/trees/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | from abc import ABC, abstractmethod
class TreeNode(object):
"""
Tree node class which will implement Tree Node
"""
def __init__(self, value):
"""
Value here can be anything
"""
self.data = value
self.left = None
self.right = None
class Tree(ABC):
... | 31.595506 | 118 | 0.637624 |
1cc6d6b1f2de678be6d376bd0fd0bd84b4e75bf5 | 378 | py | Python | product/server/views.py | abhishekpathak/recommendation-system | b91961f2baa2ab70626aaadad2f90f609c92a449 | [
"MIT"
] | null | null | null | product/server/views.py | abhishekpathak/recommendation-system | b91961f2baa2ab70626aaadad2f90f609c92a449 | [
"MIT"
] | null | null | null | product/server/views.py | abhishekpathak/recommendation-system | b91961f2baa2ab70626aaadad2f90f609c92a449 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from server import api
from server.resources import RatingsResource, RecommendationsResource, \
ProductsResource
api.add_resource(RatingsResource, '/api/v1/users/<int:user_id>/ratings')
api.add_resource(RecommendationsResource,
'/api/v1/users/<int:user_id>/recommendations'... | 31.5 | 72 | 0.746032 |
1cc6e260e3b2c14dddb9fd49c7a7d0c20c540490 | 5,217 | py | Python | tiddlyweb/web/handler/bag.py | funkyeah/tiddlyweb | 2346e6c05aa03ae9c8f2687d9ef9e46103267a8e | [
"BSD-3-Clause"
] | null | null | null | tiddlyweb/web/handler/bag.py | funkyeah/tiddlyweb | 2346e6c05aa03ae9c8f2687d9ef9e46103267a8e | [
"BSD-3-Clause"
] | null | null | null | tiddlyweb/web/handler/bag.py | funkyeah/tiddlyweb | 2346e6c05aa03ae9c8f2687d9ef9e46103267a8e | [
"BSD-3-Clause"
] | null | null | null | """
Methods for accessing Bag entities, GET the
tiddlers in the bag, list the available bags,
PUT a Bag as a JSON object.
These need some refactoring.
"""
from tiddlyweb.model.bag import Bag
from tiddlyweb.model.collections import Tiddlers
from tiddlyweb.model.policy import create_policy_check
from tiddlyweb.store im... | 30.869822 | 77 | 0.689668 |
1cc70399a1a92adba636ec5ab9f2ad2aefc3c50e | 5,105 | py | Python | 7_split_sets.py | webclinic017/time-series-pipeline | 5ac418b91e395a48cba397f95d25d221adfff9bd | [
"MIT"
] | 3 | 2021-08-28T10:55:12.000Z | 2021-12-01T20:42:38.000Z | 7_split_sets.py | webclinic017/time-series-pipeline | 5ac418b91e395a48cba397f95d25d221adfff9bd | [
"MIT"
] | null | null | null | 7_split_sets.py | webclinic017/time-series-pipeline | 5ac418b91e395a48cba397f95d25d221adfff9bd | [
"MIT"
] | 1 | 2021-09-26T16:07:24.000Z | 2021-09-26T16:07:24.000Z | import os
import pathlib
import math
import pandas as pd
import numpy as np
from utils.split_pruning import getTrainTimes
# Load the data
PATH = pathlib.Path(__file__).resolve().parent / "1_processed data"
df = pd.read_csv(
os.path.join(PATH, "4_merged2.csv"),
index_col=[0, 1],
parse_dates=["Date", "Labe... | 39.573643 | 124 | 0.705583 |
1cc70abe9664a4e376ab25fb09b771cd1e6eee0e | 187 | py | Python | BusinessCard_Scanner/bcscanner.py | prathimacode-hub/MLH-LocalHackDay_Share | ee6c2472a36895a0789527ec3da7905f7bc93393 | [
"MIT"
] | null | null | null | BusinessCard_Scanner/bcscanner.py | prathimacode-hub/MLH-LocalHackDay_Share | ee6c2472a36895a0789527ec3da7905f7bc93393 | [
"MIT"
] | null | null | null | BusinessCard_Scanner/bcscanner.py | prathimacode-hub/MLH-LocalHackDay_Share | ee6c2472a36895a0789527ec3da7905f7bc93393 | [
"MIT"
] | null | null | null | mport pytesseract as tess
tess.pytesseract.tesseract_cmd = r'Path to the tesseract.exe'
from PIL import Image
img = Image.open('bc.png')
text = tess.image_to_string(img);
print(text)
| 17 | 61 | 0.759358 |
1cc7246949db562cad317d9f76f55e0e2e8a5967 | 7,049 | py | Python | zerver/lib/slack_message_conversion.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | null | null | null | zerver/lib/slack_message_conversion.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | null | null | null | zerver/lib/slack_message_conversion.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | null | null | null | import re
from typing import Any, Dict, Tuple, List
# stubs
ZerverFieldsT = Dict[str, Any]
AddedUsersT = Dict[str, int]
# Slack link can be in the format <http://www.foo.com|www.foo.com> and <http://foo.com/>
LINK_REGEX = r"""
(<) # match '>'
... | 45.477419 | 107 | 0.480777 |
1cc7390339ce06eeb9b5cec13f01715e28508b91 | 10,915 | py | Python | otp/chat/ChatInputWhiteListFrame.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 1 | 2018-06-16T23:06:38.000Z | 2018-06-16T23:06:38.000Z | otp/chat/ChatInputWhiteListFrame.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | otp/chat/ChatInputWhiteListFrame.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | import sys
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import FSM
from direct.gui.DirectGui import *
from direct.task import Task
from pandac.PandaModules import *
from otp.chat.ChatInputTyped import ChatInputTyped
from otp.otpbase import OTPGlobals
from otp.otpbase import OTPLocalizer
from toont... | 36.023102 | 236 | 0.598809 |
1cc73d5ad50fdb6a8c3a9b45ac6dd4ff10305507 | 646 | py | Python | Take1/LossFuncs.py | gamerDecathlete/NormalizingFlowsNMT | 5bff15058cad26c52002c026daa906b5aa8b894b | [
"MIT"
] | null | null | null | Take1/LossFuncs.py | gamerDecathlete/NormalizingFlowsNMT | 5bff15058cad26c52002c026daa906b5aa8b894b | [
"MIT"
] | null | null | null | Take1/LossFuncs.py | gamerDecathlete/NormalizingFlowsNMT | 5bff15058cad26c52002c026daa906b5aa8b894b | [
"MIT"
] | null | null | null | import torch
import torch.nn
class SimpleLossCompute:
"""A simple loss compute and train function."""
def __init__(self, generator, criterion, opt=None):
self.generator = generator
self.criterion = criterion
self.opt = opt
def __call__(self, x, y, norm):
x = self.generato... | 28.086957 | 66 | 0.551084 |
1cc746e9bba218716997923302eb65949b394971 | 5,002 | py | Python | Odds and ends/Alternate Data Streams/pyads.py | DrapsTV/DrapsTV_Materials | 1aee31df2d622a312b0d3f4eb2d29080a8043828 | [
"MIT"
] | 20 | 2016-06-16T12:05:45.000Z | 2020-11-25T06:31:53.000Z | Odds and ends/Alternate Data Streams/pyads.py | AyushLalShrestha/DrapsTV_Materials | 1aee31df2d622a312b0d3f4eb2d29080a8043828 | [
"MIT"
] | null | null | null | Odds and ends/Alternate Data Streams/pyads.py | AyushLalShrestha/DrapsTV_Materials | 1aee31df2d622a312b0d3f4eb2d29080a8043828 | [
"MIT"
] | 22 | 2016-05-02T10:16:17.000Z | 2020-12-30T13:02:25.000Z | '''
Copyright © 2015, Robin David - MIT-Licensed
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, d... | 36.510949 | 134 | 0.636545 |
1cc789e458aadbc9899dcb18cda94f58360ab2c9 | 273 | py | Python | terrascript/christmas-tree/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/christmas-tree/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/christmas-tree/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/christmas_tree/r.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class christmas_tree(terrascript.Resource):
pass
| 19.5 | 79 | 0.78022 |
1cc839d4d5ec16de9608ea3db3e0e09d90fff888 | 47,213 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/aio/operations/_domains_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/aio/operations/_domains_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_12_01/aio/operations/_domains_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 45.353506 | 563 | 0.677822 |
1cc841fbf5e297019914cce2f61c198a8b8ea6c0 | 2,191 | py | Python | setup.py | yoleg/proxytest | 63c85b9b14c35de72fce4542ae44080ee6082efb | [
"MIT"
] | 2 | 2020-01-09T14:42:50.000Z | 2020-08-18T10:26:55.000Z | setup.py | yoleg/proxytest | 63c85b9b14c35de72fce4542ae44080ee6082efb | [
"MIT"
] | null | null | null | setup.py | yoleg/proxytest | 63c85b9b14c35de72fce4542ae44080ee6082efb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
The packaging script.
Example:
python3 setup.py sdist bdist_wheel
"""
import os
import sys
import warnings
from pathlib import Path
from setuptools import setup
import proxytest
if sys.version_info < (3, 4):
warnings.warn('Python 3.4 or above is recommended!')
base_path = str(Pa... | 28.454545 | 77 | 0.67047 |
1cc885b4ae1da71cb3483ca10da1967775d6440c | 727 | py | Python | sciwing/commands/validators.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 50 | 2019-09-13T10:32:29.000Z | 2022-02-14T16:52:53.000Z | sciwing/commands/validators.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 31 | 2019-09-03T11:06:03.000Z | 2021-08-20T14:57:09.000Z | sciwing/commands/validators.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 9 | 2019-09-16T03:25:15.000Z | 2021-05-11T10:28:25.000Z | """
Utility functions for validation.
"""
import pathlib
def is_valid_python_classname(name: str):
""" Indicates whether name is a valid Python identifier
Parameters
----------
name : str
A string representing a class name
Returns
-------
bool
True when name is a valid py... | 19.131579 | 68 | 0.621733 |
1cc89a72c4452f088ca0ad67856fd09212d12179 | 13,088 | py | Python | evaluation/io_task4.py | Blank-Wang/dcase2017_task4_cvssp | fc7b604dcea6d9ca4dbcde8a33da3346fdda271c | [
"MIT"
] | 151 | 2017-09-19T17:02:18.000Z | 2021-12-29T02:56:47.000Z | evaluation/io_task4.py | MaigoAkisame/dcase2017_task4_cvssp | fc7b604dcea6d9ca4dbcde8a33da3346fdda271c | [
"MIT"
] | 11 | 2017-10-10T21:01:27.000Z | 2020-12-09T13:22:17.000Z | evaluation/io_task4.py | yongxuUSTC/dcase2017_task4_cvssp | 97ab1e29709bc87c9c1f9459929fb3853e7fa664 | [
"MIT"
] | 57 | 2017-09-22T22:13:33.000Z | 2021-12-01T09:03:58.000Z | """
SUMMARY: DCASE 2017 task 4 io.
AUTHOR: Qiuqiang Kong
Created: 2017.07.12
Modified: -
--------------------------------------
"""
import numpy as np
import csv
import os
import gzip
from vad import vad
def create_folder(fd):
if not os.path.exists(fd):
os.makedirs(fd)
def get_my_open(path):
suf... | 31.386091 | 90 | 0.556311 |
1cc89d406da4d8be8932ee975b281ee1fbd6a5d5 | 2,164 | py | Python | python/phonenumbers/data/region_PS.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 2 | 2019-03-30T02:12:54.000Z | 2021-03-08T18:59:40.000Z | python/phonenumbers/data/region_PS.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | null | null | null | python/phonenumbers/data/region_PS.py | Eyepea/python-phonenumbers | 0336e191fda80a21ed5c19d5e029ad8c70f620ee | [
"Apache-2.0"
] | 1 | 2018-11-10T03:47:34.000Z | 2018-11-10T03:47:34.000Z | """Auto-generated file, do not edit by hand. PS metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_PS = PhoneMetadata(id='PS', country_code=970, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[24589]\\d{7,8}|1(?:[78]\\d{8}|[49]\\d{2... | 98.363636 | 168 | 0.737061 |
1cc8bb28d8d72862647fe59bf50f786a225ab3ec | 25,741 | py | Python | modin/pandas/test/test_groupby.py | manesioz/modin | 637e148dba354825307f3f131fa2185ad5a6b54a | [
"Apache-2.0"
] | null | null | null | modin/pandas/test/test_groupby.py | manesioz/modin | 637e148dba354825307f3f131fa2185ad5a6b54a | [
"Apache-2.0"
] | null | null | null | modin/pandas/test/test_groupby.py | manesioz/modin | 637e148dba354825307f3f131fa2185ad5a6b54a | [
"Apache-2.0"
] | null | null | null | import pytest
import pandas
import numpy as np
import modin.pandas as pd
from modin.pandas.utils import from_pandas, to_pandas
pd.DEFAULT_NPARTITIONS = 4
def ray_df_equals_pandas(ray_df, pandas_df):
assert isinstance(ray_df, pd.DataFrame)
# Order may not match here, but pandas behavior can change, so we will... | 33.257106 | 88 | 0.706849 |
1cc8c22a92077342f974551e5f772c39e725063f | 1,697 | py | Python | camply/config/file_config.py | grantland/camply | aec4c6b82380fdc85f254563d8e8de290edc05ad | [
"MIT"
] | null | null | null | camply/config/file_config.py | grantland/camply | aec4c6b82380fdc85f254563d8e8de290edc05ad | [
"MIT"
] | null | null | null | camply/config/file_config.py | grantland/camply | aec4c6b82380fdc85f254563d8e8de290edc05ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Author:: Justin Flannery (mailto:juftin@juftin.com)
"""
Project Configuration for Yellowstone Variables
"""
from collections import OrderedDict
from os.path import abspath, join
from pathlib import Path
from typing import List
class FileConfig:
"""
File Path Storage Class
"... | 40.404762 | 93 | 0.690041 |
1cc8c6fbe1bf5cb5ade44b56ce37ff5532924ee5 | 29,768 | py | Python | larch/wxlib/plotter.py | Bob620/xraylarch | f8d38e6122cc0e8c990b0f024db3b503a5fbf057 | [
"BSD-2-Clause"
] | null | null | null | larch/wxlib/plotter.py | Bob620/xraylarch | f8d38e6122cc0e8c990b0f024db3b503a5fbf057 | [
"BSD-2-Clause"
] | null | null | null | larch/wxlib/plotter.py | Bob620/xraylarch | f8d38e6122cc0e8c990b0f024db3b503a5fbf057 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
'''
Plotting functions for Larch, wrapping the mplot plotting
widgets which use matplotlib
Exposed functions here are
plot: display 2D line plot to an enhanced,
configurable Plot Frame
oplot: overplot a 2D line plot on an existing Plot Frame
imshow: display a false-col... | 35.353919 | 97 | 0.611395 |
1cc9120d34cd7764bfe56d08b4216739df19b3db | 1,367 | py | Python | docs/diagrams/build.py | poletaevvlad/CubeLang | 06f34e7204f4656589eb33c4afe660383704861f | [
"MIT"
] | 1 | 2019-12-04T04:02:11.000Z | 2019-12-04T04:02:11.000Z | docs/diagrams/build.py | poletaevvlad/CubeLang | 06f34e7204f4656589eb33c4afe660383704861f | [
"MIT"
] | null | null | null | docs/diagrams/build.py | poletaevvlad/CubeLang | 06f34e7204f4656589eb33c4afe660383704861f | [
"MIT"
] | null | null | null | import railroad
import os
from io import StringIO
import re
RUNTIME = {"Diagram": railroad.Diagram,
"Terminal": railroad.Terminal,
"NonTerminal": railroad.NonTerminal,
"Comment": railroad.Comment,
"Skip": railroad.Skip,
"Start": railroad.Start,
"End": r... | 30.377778 | 67 | 0.575713 |
1cc922eabd419f79a0d3ceda53764e728d431725 | 710 | py | Python | scratch/triangles.py | TonySoloProjects/lake_analyses | 08a07306b4da3b85e3445732999cb0742ca03e87 | [
"FTL"
] | null | null | null | scratch/triangles.py | TonySoloProjects/lake_analyses | 08a07306b4da3b85e3445732999cb0742ca03e87 | [
"FTL"
] | null | null | null | scratch/triangles.py | TonySoloProjects/lake_analyses | 08a07306b4da3b85e3445732999cb0742ca03e87 | [
"FTL"
] | null | null | null | # Scratch Code
import matplotlib.pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.patches import Polygon
import numpy as np
fig,ax = plt.subplots(1)
N = 10
nfloors = np.random.rand(N) # some random data
patches = []
cmap = plt.get_cmap('RdYlBu')
colors = cmap(nfloors) # convert nflo... | 22.1875 | 75 | 0.746479 |
1cc927e5669ada529f5a8ce1b277febca10455d6 | 604 | py | Python | cloudmesh/pi/camera.py | cloudmesh/cloudmesh.pi | bdf706b3763031341c41b811749064c293e73c14 | [
"Apache-2.0"
] | 2 | 2017-09-18T00:56:36.000Z | 2018-06-01T23:41:23.000Z | cloudmesh/pi/camera.py | cloudmesh/cloudmesh-pi | bdf706b3763031341c41b811749064c293e73c14 | [
"Apache-2.0"
] | 1 | 2018-04-16T18:37:17.000Z | 2018-04-16T18:37:17.000Z | cloudmesh/pi/camera.py | cloudmesh/cloudmesh.pi | bdf706b3763031341c41b811749064c293e73c14 | [
"Apache-2.0"
] | 3 | 2017-09-20T11:13:54.000Z | 2017-11-30T23:48:37.000Z | import picamera
import time
import os
class Camera:
def __init__(self):
"""
initialize the camera
"""
self.cam = picamera.PiCamera()
self.cam.preview_window = (620, 320, 640, 480)
def get(self, filename = "image.jpg"):
"""
get an image from the camera
save the image to filename (image.jpg by default... | 16.324324 | 51 | 0.655629 |
1cc92d048074f6ba5db14b7807c4cc3c10b9143e | 76,148 | py | Python | tensorlayer/layers/convolution.py | lllcho/tensorlayer | 87591b4945a6a67dfb4ea797a575efae997fd9d2 | [
"Apache-2.0"
] | null | null | null | tensorlayer/layers/convolution.py | lllcho/tensorlayer | 87591b4945a6a67dfb4ea797a575efae997fd9d2 | [
"Apache-2.0"
] | null | null | null | tensorlayer/layers/convolution.py | lllcho/tensorlayer | 87591b4945a6a67dfb4ea797a575efae997fd9d2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import tensorflow as tf
from .. import _logging as logging
from .core import *
__all__ = [
'Conv1dLayer',
'Conv2dLayer',
'DeConv2dLayer',
'Conv3dLayer',
'DeConv3dLayer',
'UpSampling2dLayer',
'DownSampling2dLayer',
'DeformableConv2d',
'AtrousConv1dLayer',
... | 40.289947 | 271 | 0.599543 |
1cc95cbb60cecc936ca3684689585fd84e2778bd | 2,376 | py | Python | src/metaworlds/envs/mujoco/hopper_env.py | rlworkgroup/metaworlds | be03cfed9890a37b84283c597209b849e8a086cc | [
"MIT"
] | 5 | 2019-02-27T20:55:30.000Z | 2019-08-24T19:24:41.000Z | src/metaworlds/envs/mujoco/hopper_env.py | rlworkgroup/metaworlds | be03cfed9890a37b84283c597209b849e8a086cc | [
"MIT"
] | 8 | 2019-02-28T04:07:10.000Z | 2020-01-02T10:54:10.000Z | src/metaworlds/envs/mujoco/hopper_env.py | rlworkgroup/metaworlds | be03cfed9890a37b84283c597209b849e8a086cc | [
"MIT"
] | 1 | 2021-09-13T18:35:34.000Z | 2021-09-13T18:35:34.000Z | import numpy as np
from metaworlds.core import Serializable
from metaworlds.envs import Step
from metaworlds.envs.mujoco import MujocoEnv
from metaworlds.misc import autoargs
from metaworlds.misc import logger
from metaworlds.misc.overrides import overrides
# states: [
# 0: z-coord,
# 1: x-coord (forward distance),
#... | 33.464789 | 77 | 0.628788 |
1cc9674658f13e3e1959f371165563b50b8c6379 | 16,201 | py | Python | WP3/Task3.1/notebooks/Q3_Gender_Distribution.py | on-merrit/ON-MERRIT | a21324a54a6365f2f769b5952b0cf5347a97d480 | [
"MIT"
] | 2 | 2019-12-10T13:10:58.000Z | 2019-12-13T10:11:41.000Z | WP3/Task3.1/notebooks/Q3_Gender_Distribution.py | on-merrit/ON-MERRIT | a21324a54a6365f2f769b5952b0cf5347a97d480 | [
"MIT"
] | 4 | 2020-03-31T12:13:45.000Z | 2020-04-15T15:59:17.000Z | WP3/Task3.1/notebooks/Q3_Gender_Distribution.py | on-merrit/ON-MERRIT | a21324a54a6365f2f769b5952b0cf5347a97d480 | [
"MIT"
] | 1 | 2020-02-26T08:52:39.000Z | 2020-02-26T08:52:39.000Z | #!/usr/bin/env python
# coding: utf-8
# # This will create plots for institutions of universities in THE WUR univs only and for the period of 2007-2017. The input dataset contains info of THE WUR univs only but for any period of time.
# #### This is to be compatible with other analysis questions which used dataset fr... | 32.532129 | 465 | 0.696377 |
1cc968b8fe62ed2af103db33a2be50ab38363e87 | 6,044 | py | Python | pygraphviz/doc/source/conf.py | Yen-HuaChen/hLDA | d3acaab83f4a7d681d599de44ff3a043bf2b59ac | [
"MIT"
] | 5 | 2017-12-18T16:57:05.000Z | 2019-11-11T15:43:16.000Z | pygraphviz/doc/source/conf.py | Yen-HuaChen/hLDA | d3acaab83f4a7d681d599de44ff3a043bf2b59ac | [
"MIT"
] | null | null | null | pygraphviz/doc/source/conf.py | Yen-HuaChen/hLDA | d3acaab83f4a7d681d599de44ff3a043bf2b59ac | [
"MIT"
] | 2 | 2018-04-19T09:16:16.000Z | 2020-07-09T21:22:43.000Z | # -*- coding: utf-8 -*-
#
# Sphinx documentation build configuration file, created by
# sphinx-quickstart.py on Sat Mar 8 21:47:50 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickl... | 30.994872 | 88 | 0.693746 |
1cc98a4da719edbfca4681aa423d4a642f11a303 | 3,856 | py | Python | sbin/compare_image_dirs.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | 6 | 2015-12-15T04:09:08.000Z | 2020-02-21T01:40:57.000Z | sbin/compare_image_dirs.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | null | null | null | sbin/compare_image_dirs.py | pmacosta/putil | 416cea52df8221981727e25d133e9b4e3f464798 | [
"MIT"
] | 2 | 2016-01-21T23:29:17.000Z | 2020-02-21T01:41:05.000Z | #!/usr/bin/env python
# compare_image_dirs.py
# Copyright (c) 2013-2016 Pablo Acosta-Serafini
# See LICENSE for details
# pylint: disable=C0111
# Standard library imports
from __future__ import print_function
import argparse
import glob
import os
import sys
# PyPI imports
import numpy
import scipy
import scipy.misc
# ... | 29.891473 | 76 | 0.599585 |
1cc98d9d08904ee2cedacb4bcdd346ebb93e0339 | 4,413 | py | Python | examples/efficiency_plots.py | DESY-CBPF-UERJ/ANATools | 8e0aaca4e653ee8a0ba662c91d8fa1aa34951bfd | [
"MIT"
] | null | null | null | examples/efficiency_plots.py | DESY-CBPF-UERJ/ANATools | 8e0aaca4e653ee8a0ba662c91d8fa1aa34951bfd | [
"MIT"
] | null | null | null | examples/efficiency_plots.py | DESY-CBPF-UERJ/ANATools | 8e0aaca4e653ee8a0ba662c91d8fa1aa34951bfd | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
import anatools.data as data
import anatools.analysis as ana
ana.start()
#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# This is not a c... | 58.065789 | 202 | 0.503512 |
1cc9a5d60110da7881c0a28a41a36c8ffd509eeb | 8,311 | py | Python | gslib/addlhelp/prod.py | stanhu/gsutil | e8403ed5e07caed3027455c7b883fef733612360 | [
"Apache-2.0"
] | 649 | 2015-01-08T01:50:15.000Z | 2022-03-31T08:33:38.000Z | gslib/addlhelp/prod.py | stanhu/gsutil | e8403ed5e07caed3027455c7b883fef733612360 | [
"Apache-2.0"
] | 798 | 2015-01-02T07:46:09.000Z | 2022-03-31T20:37:19.000Z | gslib/addlhelp/prod.py | stanhu/gsutil | e8403ed5e07caed3027455c7b883fef733612360 | [
"Apache-2.0"
] | 315 | 2015-01-02T10:26:53.000Z | 2022-03-27T02:18:58.000Z | # -*- coding: utf-8 -*-
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 51.621118 | 80 | 0.750812 |
1cc9a9610e77e34764cf98133a04da5d248d1186 | 3,971 | py | Python | python_modules/libraries/dagster-msteams/dagster_msteams/sensors.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-msteams/dagster_msteams/sensors.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-msteams/dagster_msteams/sensors.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from typing import Callable, Optional
from dagster_msteams.card import Card
from dagster_msteams.client import TeamsClient
from dagster import DefaultSensorStatus
from dagster.core.definitions.run_status_sensor_definition import (
PipelineFailureSensorContext,
pipeline_failure_sensor,
)
def _default_failure... | 38.553398 | 102 | 0.670864 |
1cc9b074b9b94971d6067159f8c6447b386de76f | 163 | py | Python | qupulse/hardware/__init__.py | lankes-fzj/qupulse | 46f00f70bc998b98ac1ae4721d1a9a1c10b675aa | [
"MIT"
] | 2 | 2021-05-22T00:04:20.000Z | 2021-11-17T11:21:46.000Z | qupulse/hardware/__init__.py | bpapajewski/qupulse | c3969a4fa9eabe69c1143ad16e6e3ca5fb9c068e | [
"MIT"
] | null | null | null | qupulse/hardware/__init__.py | bpapajewski/qupulse | c3969a4fa9eabe69c1143ad16e6e3ca5fb9c068e | [
"MIT"
] | null | null | null | from qupulse.hardware.setup import HardwareSetup
from qupulse.hardware import awgs
from qupulse.hardware import dacs
__all__ = ["HardwareSetup", "awgs", "dacs"]
| 23.285714 | 48 | 0.791411 |
1cc9b22354eb3be82318064a6451c98752a60bbf | 2,151 | py | Python | test/integration/ggrc/converters/test_import_assessment_templates.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-03-30T11:28:48.000Z | 2018-03-30T11:28:48.000Z | test/integration/ggrc/converters/test_import_assessment_templates.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | test/integration/ggrc/converters/test_import_assessment_templates.py | trevordonnelly/ggrc-core | 499cf0d3cce70737b080991b12c203ec22015cea | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# pylint: disable=maybe-no-member
"""Test Assessment Template import."""
from ggrc import models
from ggrc.converters import errors
from integration.ggrc import TestCase
class TestAssessmentTemplatesImpo... | 29.875 | 78 | 0.584379 |
1cc9c6cefc5965d2f259601c923ef1d042755d27 | 5,851 | py | Python | dudley/test/python/generate_meshes.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | null | null | null | dudley/test/python/generate_meshes.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | 1 | 2019-01-14T03:07:43.000Z | 2019-01-14T03:07:43.000Z | dudley/test/python/generate_meshes.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2003-2018 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development unti... | 35.460606 | 125 | 0.531191 |
1cc9c77b80c6ab5ea42ad223be79319cf2c68a82 | 25,172 | py | Python | stoch_optim_utilities.py | edgarsmdn/TS | 134551ef7b61527fbf17575b16bc407c6847074f | [
"MIT"
] | 7 | 2020-03-01T14:13:31.000Z | 2022-02-15T02:34:58.000Z | stoch_optim_utilities.py | edgarsmdn/PSO | 746e6d8220e62841eeb469b9462599e8986f5cba | [
"MIT"
] | null | null | null | stoch_optim_utilities.py | edgarsmdn/PSO | 746e6d8220e62841eeb469b9462599e8986f5cba | [
"MIT"
] | 3 | 2020-03-10T09:33:37.000Z | 2021-06-15T08:04:38.000Z | import numpy as np
import random as rnd
'''
Utilities for Stochastic Optimization Algorithms
'''
def LS_f_v3(f, p_init, max_iter, bounds, radius, reduce_iter, reduce_frac):
'''
---------------------
LOCAL SEARCH ALGORITHM
---------------------
--- input ---
f: (func... | 39.829114 | 160 | 0.566304 |
1cc9c9e27798c1e3e87734b0b922c4e26c6707ff | 5,751 | py | Python | lightly/api/bitmask.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 1 | 2021-06-23T07:31:26.000Z | 2021-06-23T07:31:26.000Z | lightly/api/bitmask.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | null | null | null | lightly/api/bitmask.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | null | null | null | """ Module to work with Lightly BitMasks """
# Copyright (c) 2020. Lightly AG and its affiliates.
# All Rights Reserved
from typing import List
def _hex_to_int(hexstring: str) -> int:
"""Converts a hex string representation of an integer to an integer.
"""
return int(hexstring, 16)
def _bin_to_int(bin... | 29.192893 | 83 | 0.574335 |
1cc9defa1010bef12051c068577e0a92a9939481 | 5,771 | py | Python | python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_sum.py | jurafish/Paddle | 15724e745409cf6af3df99ae3eec90511e482cbc | [
"Apache-2.0"
] | 17,085 | 2016-11-18T06:40:52.000Z | 2022-03-31T22:52:32.000Z | python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_sum.py | jurafish/Paddle | 15724e745409cf6af3df99ae3eec90511e482cbc | [
"Apache-2.0"
] | 29,769 | 2016-11-18T06:35:22.000Z | 2022-03-31T16:46:15.000Z | python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_reduce_sum.py | jurafish/Paddle | 15724e745409cf6af3df99ae3eec90511e482cbc | [
"Apache-2.0"
] | 4,641 | 2016-11-18T07:43:33.000Z | 2022-03-31T15:15:02.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 36.99359 | 83 | 0.539075 |
1cca1129d971f2e3a5bccf1723ed2eb061543b4b | 1,885 | py | Python | pyscarphase/plot/color.py | uart/scarphase | be143e35e39174bc3a133a30fdb72ca1602ce288 | [
"BSD-3-Clause"
] | 6 | 2016-12-03T15:18:44.000Z | 2022-01-13T06:19:01.000Z | pyscarphase/plot/color.py | nujgnayuf/scarphase | be143e35e39174bc3a133a30fdb72ca1602ce288 | [
"BSD-3-Clause"
] | 5 | 2015-07-02T15:12:18.000Z | 2021-12-08T12:50:06.000Z | pyscarphase/plot/color.py | nujgnayuf/scarphase | be143e35e39174bc3a133a30fdb72ca1602ce288 | [
"BSD-3-Clause"
] | 6 | 2015-11-04T04:12:24.000Z | 2022-03-27T16:29:24.000Z | # Copyright (c) 2011-2013 Andreas Sembrant
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# - Redistributions of source code must retain the above copyright
# notice, this list of conditi... | 39.270833 | 73 | 0.75809 |
1cca276fee579e0481d1a7141e01539c572162a7 | 3,305 | py | Python | MHC_binding/SortGrifoniCD8.py | berkyalcinkaya/SARS-CoV-2 | 78d6d64426181aba2f3b288aa6e5c7ab32396b03 | [
"MIT"
] | null | null | null | MHC_binding/SortGrifoniCD8.py | berkyalcinkaya/SARS-CoV-2 | 78d6d64426181aba2f3b288aa6e5c7ab32396b03 | [
"MIT"
] | null | null | null | MHC_binding/SortGrifoniCD8.py | berkyalcinkaya/SARS-CoV-2 | 78d6d64426181aba2f3b288aa6e5c7ab32396b03 | [
"MIT"
] | null | null | null | percentile_threshold = 1.0
def getaverage(list1,pos):
sum_items=0.0
total_items=0.0
for line in list1:
sum_items = sum_items + float(line.split(",")[pos])
total_items=total_items+1
return (sum_items/total_items)
def length(epitope1, epitope2):
if int(epitope1.split(",")[3]... | 26.023622 | 244 | 0.633283 |
1cca3c7d48079dc2924fe35000014354bfa0726c | 9,634 | py | Python | fbm/fbm.py | chansigit/fbm | 431d984f4d775de1fafa2752db9a54c39d7ed8d0 | [
"MIT"
] | 1 | 2017-12-21T08:07:17.000Z | 2017-12-21T08:07:17.000Z | fbm/fbm.py | chansigit/fbm | 431d984f4d775de1fafa2752db9a54c39d7ed8d0 | [
"MIT"
] | null | null | null | fbm/fbm.py | chansigit/fbm | 431d984f4d775de1fafa2752db9a54c39d7ed8d0 | [
"MIT"
] | 1 | 2019-01-09T20:36:00.000Z | 2019-01-09T20:36:00.000Z | """Generate realizations of fractional Brownian motion."""
import warnings
import numpy as np
class FBM(object):
"""The FBM class.
After instantiating with n = number of increments, hurst parameter, length
of realization (default = 1) and method of generation
(default daviesharte), call fbm() for fB... | 36.218045 | 79 | 0.556778 |
1cca4475709c3a3dcfbb0b187974adda1ad76194 | 8,455 | py | Python | modules/player_actions/Merchant.py | sadmicrowave/despoina | a9791feaa0c035fb4134282b750a11be57132e07 | [
"MIT"
] | 1 | 2017-11-17T15:42:35.000Z | 2017-11-17T15:42:35.000Z | modules/player_actions/Merchant.py | sadmicrowave/despoina | a9791feaa0c035fb4134282b750a11be57132e07 | [
"MIT"
] | 7 | 2018-09-25T21:27:57.000Z | 2018-09-25T21:40:50.000Z | modules/player_actions/Merchant.py | sadmicrowave/despoina | a9791feaa0c035fb4134282b750a11be57132e07 | [
"MIT"
] | 1 | 2019-10-13T23:23:16.000Z | 2019-10-13T23:23:16.000Z | #!/usr/local/bin/python3
import textwrap
from modules.bgcolors import BgColors
from modules import items
from modules import armor
from modules import weapons
from modules.player_actions.Inventory import aInventory
######################################################################################################... | 44.036458 | 314 | 0.684329 |
1cca51c94ee9216fa1302ff2124aba922aa9a693 | 3,266 | py | Python | tests/measure_tests/string_data_tests/needleman_wunsch_similarity_test.py | cenkbircanoglu/clustering | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 23 | 2015-01-21T01:39:11.000Z | 2019-08-27T09:43:39.000Z | tests/measure_tests/string_data_tests/needleman_wunsch_similarity_test.py | cenkbircanoglu/clustering | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 1 | 2015-01-18T08:52:30.000Z | 2015-01-18T08:52:30.000Z | tests/measure_tests/string_data_tests/needleman_wunsch_similarity_test.py | cenkbircanoglu/clustering | 0a97fbf43e58e65e8d9eed30eecff00bcd47f093 | [
"MIT"
] | 6 | 2015-03-23T16:58:18.000Z | 2019-03-12T06:31:56.000Z | # coding=utf-8
from unittest import TestCase
from similarityPy.measure.string_data.needleman_wunsch_similarity import NeedlemanWunschSimilarity
from tests import test_logger
__author__ = 'cenk'
## TODO
class NeedlemanWunschSimilarityTest(TestCase):
def test_algorithm(self):
test_logger.debug("NeedlemanW... | 42.415584 | 98 | 0.657685 |
1cca5bea18a45a1586b1482e5cd0663a6d634eee | 7,339 | py | Python | src/nagiosplugin/context.py | Puneeth-n/nagiosplugin | f0a77f8e1aa64516fcbeceef7b630e0a1e33ea2f | [
"ZPL-2.1"
] | null | null | null | src/nagiosplugin/context.py | Puneeth-n/nagiosplugin | f0a77f8e1aa64516fcbeceef7b630e0a1e33ea2f | [
"ZPL-2.1"
] | null | null | null | src/nagiosplugin/context.py | Puneeth-n/nagiosplugin | f0a77f8e1aa64516fcbeceef7b630e0a1e33ea2f | [
"ZPL-2.1"
] | null | null | null | """Metadata about metrics to perform data :term:`evaluation`.
This module contains the :class:`Context` class, which is the base for
all contexts. :class:`ScalarContext` is an important specialization to
cover numeric contexts with warning and critical thresholds. The
:class:`~.check.Check` controller selects a contex... | 38.830688 | 79 | 0.650497 |
1cca5e9dfe41237def39a3bcd4d12f162e76f547 | 2,822 | py | Python | askci/apps/main/views/questions.py | hpsee/askci | ef1e2e75481b71db7fbe774cb81938055aa596d0 | [
"MIT"
] | 3 | 2019-11-21T09:04:36.000Z | 2019-11-23T13:29:43.000Z | askci/apps/main/views/questions.py | hpsee/askci | ef1e2e75481b71db7fbe774cb81938055aa596d0 | [
"MIT"
] | 13 | 2019-11-21T20:28:23.000Z | 2019-11-26T19:34:22.000Z | askci/apps/main/views/questions.py | hpsee/askci | ef1e2e75481b71db7fbe774cb81938055aa596d0 | [
"MIT"
] | null | null | null | """
Copyright (C) 2019-2020 Vanessa Sochat.
This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
from django.contrib.auth.decorators import login_required
from django.contr... | 33.595238 | 100 | 0.638554 |
1cca61b232e625ef21b7fad0018838efef22c14f | 2,090 | py | Python | test/vanilla/version-tolerant/AcceptanceTests/test_duration.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/vanilla/version-tolerant/AcceptanceTests/test_duration.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/vanilla/version-tolerant/AcceptanceTests/test_duration.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... | 43.541667 | 133 | 0.726316 |
1cca9308b64acbdab28928a39aa881944d5ff8fc | 738 | py | Python | descriptor/models/cnn_encoder.py | pskrunner14/descriptor | 05b4efa8794d0dc21b8486a549bfa7f982a08d70 | [
"MIT"
] | null | null | null | descriptor/models/cnn_encoder.py | pskrunner14/descriptor | 05b4efa8794d0dc21b8486a549bfa7f982a08d70 | [
"MIT"
] | null | null | null | descriptor/models/cnn_encoder.py | pskrunner14/descriptor | 05b4efa8794d0dc21b8486a549bfa7f982a08d70 | [
"MIT"
] | null | null | null | """ CNN Encoder model for Image Captioning CRNN model. """
# pylint:disable=E1101
from .inception import inception_v3
IMG_SIZE = 299
def get_cnn_encoder():
""" Returns the Pre-trained CNN Encoder model. """
return inception_v3(pretrained=True)
def encode(images, cnn_encoder=None):
""" Generates embeddi... | 29.52 | 69 | 0.701897 |
1cca961f6efdd533664d2577bf8a9a4a630ebdae | 1,187 | py | Python | setup.py | vishalbelsare/ZOOpt | 2ca4a9fcc0a7a2e93a225e6e193712d04c26723c | [
"MIT"
] | 403 | 2017-04-19T03:01:12.000Z | 2022-02-27T04:31:27.000Z | setup.py | vishalbelsare/ZOOpt | 2ca4a9fcc0a7a2e93a225e6e193712d04c26723c | [
"MIT"
] | 15 | 2017-05-07T10:09:32.000Z | 2020-11-18T11:33:00.000Z | setup.py | vishalbelsare/ZOOpt | 2ca4a9fcc0a7a2e93a225e6e193712d04c26723c | [
"MIT"
] | 97 | 2017-04-19T03:52:21.000Z | 2022-03-03T13:05:02.000Z | #!/usr/bin/env python
# coding=utf-8
from setuptools import setup, find_packages
setup(
name='zoopt',
version='0.3.0',
description=(
'A Python Package for Zeroth-Order Optimization'
),
author='Yang Yu',
author_email='yuy@nju.edu.cn',
maintainer='Yu-Ren Liu, Xiong-Hui Chen, Yi-Qi Hu... | 30.435897 | 74 | 0.593092 |
1cca9cd0eca87b587e938b093c7582a77645433c | 826 | py | Python | tests/data_structures/stack_test.py | alysivji/sivtools | 570dba15e9669bc4e20e7dffc60fb2c70443456f | [
"MIT"
] | 6 | 2018-09-14T16:18:00.000Z | 2022-03-27T19:50:31.000Z | tests/data_structures/stack_test.py | alysivji/sivtools | 570dba15e9669bc4e20e7dffc60fb2c70443456f | [
"MIT"
] | 11 | 2018-01-31T14:18:54.000Z | 2020-06-09T00:46:45.000Z | tests/data_structures/stack_test.py | alysivji/sivtools | 570dba15e9669bc4e20e7dffc60fb2c70443456f | [
"MIT"
] | null | null | null | import pytest
from sivtools.data_structures import Stack
def test_create_empty_stack():
stack = Stack()
assert stack.size() == 0
assert stack.is_empty() is True
assert stack.head is None
def test_stack_push():
stack = Stack()
stack.push(5)
assert stack.size() == 1
assert stack.is_... | 16.52 | 42 | 0.622276 |
1ccac9714e5a55539eeaa7f5e91a0c1493403f7c | 426 | py | Python | experiments/test-comments-simple.py | looztra/yamkix | 1a7f0fcba1bbce723da322d487f768acde23bf06 | [
"Apache-2.0"
] | 5 | 2017-10-30T09:47:30.000Z | 2022-02-16T17:42:23.000Z | experiments/test-comments-simple.py | looztra/yamkix | 1a7f0fcba1bbce723da322d487f768acde23bf06 | [
"Apache-2.0"
] | 40 | 2019-02-25T08:46:32.000Z | 2021-04-27T12:56:46.000Z | experiments/test-comments-simple.py | looztra/yamkix | 1a7f0fcba1bbce723da322d487f768acde23bf06 | [
"Apache-2.0"
] | null | null | null | """Test comments on a very simple CommentedMap."""
import sys
import ruamel.yaml
comment_column = None
insert = ruamel.yaml.comments.CommentedMap()
insert["test"] = "asdf"
insert.yaml_add_eol_comment("Test Comment!", "test", column=comment_column)
insert["second-key"] = "yop"
insert.yaml_add_eol_comment(
"Another... | 25.058824 | 75 | 0.748826 |
1ccaf1eff7f2af32e82590e7a48647e25bc0bbb4 | 11,516 | py | Python | ingestion_server/ingestion_server/ingest.py | AyanChoudhary/cccatalog-api | 9a6c691872b52048a8a92632e1674eaac61d4cb8 | [
"MIT"
] | 1 | 2019-12-09T22:23:10.000Z | 2019-12-09T22:23:10.000Z | ingestion_server/ingestion_server/ingest.py | senyor/cccatalog-api | a18f75fccdd7345beff820dff4ee69604cd53748 | [
"MIT"
] | 32 | 2021-01-07T23:49:24.000Z | 2022-03-02T15:03:41.000Z | ingestion_server/ingestion_server/ingest.py | senyor/cccatalog-api | a18f75fccdd7345beff820dff4ee69604cd53748 | [
"MIT"
] | null | null | null | import os
import psycopg2
import datetime
import logging as log
from ingestion_server.cleanup import clean_image_data
from ingestion_server.indexer import database_connect
from psycopg2.extras import DictCursor
"""
Pull the latest copy of a table from the upstream database (aka CC Catalog/the
intermediary database).
... | 39.986111 | 80 | 0.683484 |
1ccaf749c7a3f07d897684f7d241c999d8259073 | 954 | py | Python | py/167. Two Sum II - Input array is sorted.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | 3 | 2021-08-07T07:01:34.000Z | 2021-08-07T07:03:02.000Z | py/167. Two Sum II - Input array is sorted.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | py/167. Two Sum II - Input array is sorted.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/
# Given an array of integers numbers that is already sorted in non-decreasing
# order, find two numbers such that they add up to a specific target number.
# Return the indices of the two numbers (1-indexed) as an integer array answer of
# size 2, where... | 36.692308 | 82 | 0.561845 |
1ccb35cc4175a51a72412c437a0a7b4693cda7bd | 11,865 | py | Python | cartridge/shop/payment/paypal.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | cartridge/shop/payment/paypal.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | cartridge/shop/payment/paypal.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import unicode_literals
try:
from urllib.request import Request, urlopen
from urllib.error import URLError
except ImportError:
from urllib2 import Request, urlopen, URLError
import locale
from django.core.exceptions import ImproperlyConfigured
from django.http import QueryDict
from django... | 30.898438 | 77 | 0.547661 |
1ccb7b06a85414e139b6fb8c9383bec2b1bd62e3 | 911 | py | Python | tests/response_bins_tests.py | derekjamescurtis/veritranspay | 0367f8b261293e49ee8a6e395f6c44455212cf7b | [
"BSD-3-Clause"
] | 6 | 2015-07-12T09:46:59.000Z | 2017-06-19T18:38:12.000Z | tests/response_bins_tests.py | derekjamescurtis/veritranspay | 0367f8b261293e49ee8a6e395f6c44455212cf7b | [
"BSD-3-Clause"
] | 8 | 2015-01-21T17:00:42.000Z | 2017-07-06T05:26:30.000Z | tests/response_bins_tests.py | derekjamescurtis/veritranspay | 0367f8b261293e49ee8a6e395f6c44455212cf7b | [
"BSD-3-Clause"
] | 6 | 2015-07-21T16:49:57.000Z | 2017-07-05T07:55:35.000Z | from unittest import TestCase
from veritranspay.response import BinResponse
class BinsRequestResponseTests(TestCase):
def setUp(self):
# example response data from
# --
self.response_json = {
"data": {
"country_name": "Indonesia",
"country_code... | 28.46875 | 102 | 0.566411 |
1ccb7caed336de15c72bb97af1ad828582c4c63b | 434 | py | Python | tests/python/test_numpy.py | ericjang/taichi | 0dec0bac6d9c16b7b62ba528f9e0d4268d1d05d2 | [
"MIT"
] | null | null | null | tests/python/test_numpy.py | ericjang/taichi | 0dec0bac6d9c16b7b62ba528f9e0d4268d1d05d2 | [
"MIT"
] | 1 | 2020-07-21T05:51:19.000Z | 2020-10-08T01:31:15.000Z | tests/python/test_numpy.py | hoojaoh/taichi | 641c4b83bcf98e7354b135964cd23759b0110c6b | [
"MIT"
] | null | null | null | import taichi as ti
import numpy as np
@ti.program_test
def test_numpy():
val = ti.var(ti.i32)
n = 4
@ti.layout
def values():
ti.root.dense(ti.i, n).place(val)
@ti.kernel
def test_numpy(arr: np.ndarray):
for i in range(n):
arr[i] = arr[i] ** 2
a = np.array([4, 8, 1, 24], dtype=np.float3... | 15.5 | 47 | 0.562212 |
1ccb938545300b4e7c713d55cb08deb1cbf60818 | 3,212 | py | Python | test/api/document/test_split_document_to_format.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 14 | 2018-07-15T17:01:52.000Z | 2018-11-29T06:15:33.000Z | test/api/document/test_split_document_to_format.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 1 | 2018-09-28T12:59:34.000Z | 2019-10-08T08:42:59.000Z | test/api/document/test_split_document_to_format.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 2 | 2020-12-21T07:59:17.000Z | 2022-02-16T21:41:25.000Z | # -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="test_split_document_to_format.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of thi... | 49.415385 | 216 | 0.715442 |
1ccb93f081b6a112626cfeac2cf47fece03924db | 3,256 | py | Python | pytorch/examples/FastCells/fastcell_example.py | krantikiran/EdgeML | e5c7bd7c56884ca61f6d54cedb0074553cfdc896 | [
"MIT"
] | 1 | 2020-03-26T17:19:54.000Z | 2020-03-26T17:19:54.000Z | pytorch/examples/FastCells/fastcell_example.py | krantikiran/EdgeML | e5c7bd7c56884ca61f6d54cedb0074553cfdc896 | [
"MIT"
] | 2 | 2020-03-26T02:59:12.000Z | 2020-04-23T19:09:00.000Z | pytorch/examples/FastCells/fastcell_example.py | krantikiran/EdgeML | e5c7bd7c56884ca61f6d54cedb0074553cfdc896 | [
"MIT"
] | 3 | 2020-03-25T18:45:39.000Z | 2020-12-17T19:09:54.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import helpermethods
import torch
import numpy as np
import sys
from pytorch_edgeml.graph.rnn import *
from pytorch_edgeml.trainer.fastTrainer import FastTrainer
def main():
# change cuda:0 to cuda:gpuid for specific al... | 35.010753 | 77 | 0.612101 |
1ccb949a904d3f62b21b6ce143979ff3123a01aa | 6,972 | py | Python | clients/kratos/python/ory_kratos_client/model/meta.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/model/meta.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | clients/kratos/python/ory_kratos_client/model/meta.py | kolotaev/sdk | 0dda1becd70be8d7b9d678321ebe780c1ba00485 | [
"Apache-2.0"
] | null | null | null | """
Ory Kratos API
Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the admini... | 40.300578 | 446 | 0.597103 |
1ccb95a96a9467b5c09b6678bdbe2a3c7d4b5792 | 3,790 | py | Python | catkin_ws/devel/lib/python3/dist-packages/fundamentals/msg/_MissionStatusGoal.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | 1 | 2021-09-19T07:51:23.000Z | 2021-09-19T07:51:23.000Z | catkin_ws/install/lib/python3/dist-packages/fundamentals/msg/_MissionStatusGoal.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | null | null | null | catkin_ws/install/lib/python3/dist-packages/fundamentals/msg/_MissionStatusGoal.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from fundamentals/MissionStatusGoal.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class MissionStatusGoal(genpy.Message):
_md5sum = "b3087778e93fcd34cc8... | 32.956522 | 145 | 0.663588 |
1ccbe0fe3d365b7649c1594458c828fe5d83e77f | 2,548 | py | Python | eventio/scripts/plot_hists.py | mblnk/pyeventio | 072dbd698f3bcd8e60eff0eeddcf828615b28db8 | [
"MIT"
] | 5 | 2016-11-18T15:53:00.000Z | 2018-11-29T15:36:40.000Z | eventio/scripts/plot_hists.py | mblnk/pyeventio | 072dbd698f3bcd8e60eff0eeddcf828615b28db8 | [
"MIT"
] | 69 | 2018-12-12T16:17:09.000Z | 2022-03-21T10:44:40.000Z | eventio/scripts/plot_hists.py | mblnk/pyeventio | 072dbd698f3bcd8e60eff0eeddcf828615b28db8 | [
"MIT"
] | 11 | 2018-12-12T17:45:57.000Z | 2022-02-09T12:41:08.000Z | from eventio import EventIOFile, Histograms
import matplotlib.pyplot as plt
from eventio.search_utils import yield_toplevel_of_type
import numpy as np
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('inputfile')
parser.add_argument(
'-o', '--output-base',
help='if given, save... | 30.698795 | 79 | 0.481947 |
1ccbe39848809a21b2a3cc7befdf63b02668664f | 3,015 | py | Python | salt/modules/test.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | 1 | 2015-10-06T22:25:22.000Z | 2015-10-06T22:25:22.000Z | salt/modules/test.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | salt/modules/test.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | '''
Module for running arbitrary tests
'''
# Import salt libs
import time
def echo(text):
'''
Return a string - used for testing the connection
CLI Example::
salt '*' test.echo 'foo bar baz quo qux'
'''
return text
def ping():
'''
Just used to make sure the minion is up and re... | 18.962264 | 77 | 0.593035 |
1ccbe4a522211f618fd88d005d1076666c1603e5 | 17,137 | py | Python | toontown/building/DistributedSuitInteriorAI.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 1 | 2018-06-16T23:06:38.000Z | 2018-06-16T23:06:38.000Z | toontown/building/DistributedSuitInteriorAI.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/building/DistributedSuitInteriorAI.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | import copy
import random
from toontown.building import DistributedElevatorIntAI
from toontown.building.ElevatorConstants import *
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObjectAI
from direct.distributed.ClockDelta import *
from direct.fsm import ClassicFSM, State
fr... | 37.498906 | 166 | 0.601739 |
1ccbf30266c07fe2c370aa7ffde34e6f3357f15b | 1,654 | py | Python | src/decisionengine_modules/glideinwms/resource_dist_plugins.py | goodenou/decisionengine_modules | cf4311949d3c5fd991d1c5c4a6a190ba53a2eb71 | [
"BSD-3-Clause"
] | 2 | 2020-03-17T15:51:19.000Z | 2022-02-23T15:45:37.000Z | src/decisionengine_modules/glideinwms/resource_dist_plugins.py | goodenou/decisionengine_modules | cf4311949d3c5fd991d1c5c4a6a190ba53a2eb71 | [
"BSD-3-Clause"
] | 358 | 2020-03-02T20:06:38.000Z | 2022-03-28T20:39:01.000Z | src/decisionengine_modules/glideinwms/resource_dist_plugins.py | goodenou/decisionengine_modules | cf4311949d3c5fd991d1c5c4a6a190ba53a2eb71 | [
"BSD-3-Clause"
] | 34 | 2020-02-24T17:17:11.000Z | 2022-01-13T21:50:11.000Z | import pandas as pd
_RESOURCE_FROM_COLUMN_MAP = {
"Grid_Figure_Of_Merit": "Grid_Figure_Of_Merit",
"GCE_Figure_Of_Merit": "FigureOfMerit",
"AWS_Figure_Of_Merit": "AWS_Figure_Of_Merit",
"Nersc_Figure_Of_Merit": "FigureOfMerit",
}
def order_resources(resources, logger=None):
ordered_resources = []
... | 38.465116 | 112 | 0.667473 |
1ccc14e425102cd7088c568e1b90a5c99a045d5a | 576 | py | Python | politicalplaces/migrations/0006_mapitem_parent.py | 20tab/django-political-map | ca43fd492e65450b063a67580978e9a8e86c7b08 | [
"MIT"
] | 9 | 2017-02-24T20:01:11.000Z | 2021-07-20T09:35:55.000Z | politicalplaces/migrations/0006_mapitem_parent.py | 20tab/django-political-map | ca43fd492e65450b063a67580978e9a8e86c7b08 | [
"MIT"
] | 9 | 2017-03-01T18:34:01.000Z | 2021-06-01T22:01:23.000Z | politicalplaces/migrations/0006_mapitem_parent.py | 20tab/django-political-map | ca43fd492e65450b063a67580978e9a8e86c7b08 | [
"MIT"
] | 4 | 2017-03-01T10:29:46.000Z | 2019-09-29T01:31:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-06 15:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('politicalplaces', '0005_auto_20170119_1737'),
]
op... | 26.181818 | 135 | 0.663194 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.