hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1266ad0f5b6766456320fd9da87836ee3d96ebd9 | 2,651 | py | Python | test/test_boxplot.py | Dorian-Boully/tikzplotlib | 1b9139cf642f9a392892dfcf556eb0ba729154fd | [
"MIT"
] | null | null | null | test/test_boxplot.py | Dorian-Boully/tikzplotlib | 1b9139cf642f9a392892dfcf556eb0ba729154fd | [
"MIT"
] | null | null | null | test/test_boxplot.py | Dorian-Boully/tikzplotlib | 1b9139cf642f9a392892dfcf556eb0ba729154fd | [
"MIT"
] | null | null | null | """ Box Plot test
This test plots a box plot with three data series. The causes an empty Line2D
to be plotted. Without care, this can turn into an empty table in PGFPlot
which crashes latex (due to it treating an empty table as a table with
external data in the file '' or '.tex')
See: https://github.com/nschloe/tikzpl... | 27.05102 | 77 | 0.558657 |
e7329b62ad1e5542f7f0a4f35c64ff7c7191e160 | 2,250 | py | Python | salt/renderers/jinja.py | GLaN1K/salt | ec1a907465c2d6dff126b747a52035e19b9a105b | [
"Apache-2.0"
] | 1 | 2021-02-26T07:37:19.000Z | 2021-02-26T07:37:19.000Z | salt/renderers/jinja.py | GLaN1K/salt | ec1a907465c2d6dff126b747a52035e19b9a105b | [
"Apache-2.0"
] | 4 | 2021-02-06T14:30:48.000Z | 2021-12-13T20:50:10.000Z | salt/renderers/jinja.py | GLaN1K/salt | ec1a907465c2d6dff126b747a52035e19b9a105b | [
"Apache-2.0"
] | 1 | 2021-05-10T13:59:33.000Z | 2021-05-10T13:59:33.000Z | """
Jinja loading utils to enable a more powerful backend for jinja templates
For Jinja usage information see :ref:`Understanding Jinja <understanding-jinja>`.
"""
import logging
from io import StringIO
import salt.utils.templates
from salt.exceptions import SaltRenderError
from salt.loader_context import NamedLoad... | 26.785714 | 87 | 0.650667 |
f9084225c4a7cfd4c54e16cdb647bc89539fca73 | 1,982 | py | Python | ex9.py | adamlukomski/pykron | 5e4c4b840af2cf574dab8417a97b7f0fc4080878 | [
"BSD-2-Clause"
] | null | null | null | ex9.py | adamlukomski/pykron | 5e4c4b840af2cf574dab8417a97b7f0fc4080878 | [
"BSD-2-Clause"
] | null | null | null | ex9.py | adamlukomski/pykron | 5e4c4b840af2cf574dab8417a97b7f0fc4080878 | [
"BSD-2-Clause"
] | null | null | null | """
BSD 2-Clause License
Copyright (c) 2020, Davide De Tommaso (dtmdvd@gmail.com)
Social Cognition in Human-Robot Interaction
Istituto Italiano di Tecnologia (IIT)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitte... | 34.77193 | 78 | 0.757316 |
8b553d6aaefc936296fc6a59635bd2b16af07449 | 4,578 | py | Python | Analysis/CardioVascularLab/Testing/Visualizer/PlotsForBinnedData.py | sassystacks/TissueMechanicsLab | 0f881a57ebf7cbadfeb2041daabd4e4b79b25b91 | [
"MIT"
] | null | null | null | Analysis/CardioVascularLab/Testing/Visualizer/PlotsForBinnedData.py | sassystacks/TissueMechanicsLab | 0f881a57ebf7cbadfeb2041daabd4e4b79b25b91 | [
"MIT"
] | null | null | null | Analysis/CardioVascularLab/Testing/Visualizer/PlotsForBinnedData.py | sassystacks/TissueMechanicsLab | 0f881a57ebf7cbadfeb2041daabd4e4b79b25b91 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import matplotlib.transforms as transforms
import numpy as np
class BinnedDataPlotter:
def __init__(self, dataDict):
self.dataDict = dataDict
self.elipses = []
self.fig, self.ax = plt.subplots(figsize=(10,20))
def _... | 35.765625 | 100 | 0.512232 |
7f5a0cfce0b27856b6802995ddfb600f074c60cc | 2,010 | py | Python | eve_module/market/market.py | alentoghostflame/StupidEveAppraisalBot | a78adb206efd3a4dc41cbbfb45ee0b8b61aea248 | [
"MIT"
] | null | null | null | eve_module/market/market.py | alentoghostflame/StupidEveAppraisalBot | a78adb206efd3a4dc41cbbfb45ee0b8b61aea248 | [
"MIT"
] | null | null | null | eve_module/market/market.py | alentoghostflame/StupidEveAppraisalBot | a78adb206efd3a4dc41cbbfb45ee0b8b61aea248 | [
"MIT"
] | null | null | null | from eve_module.market import text, pricecheck
from eve_module.storage import MarketManager
from evelib import EVEManager
from discord.ext import commands, tasks
from alento_bot import StorageManager
from typing import Dict, List, Optional
import asyncio
import logging
logger = logging.getLogger("main_bot")
class E... | 37.222222 | 116 | 0.732836 |
182b5fb894bd8dc6fb172e438c467455d117f5dc | 12,225 | py | Python | .venv/lib/python3.8/site-packages/msrest/pipeline/__init__.py | taharh/label-studio | fab68de11bdc6699472d12a78390375928258e1e | [
"Apache-2.0"
] | 38 | 2016-10-17T22:28:26.000Z | 2022-03-08T05:08:21.000Z | .venv/lib/python3.8/site-packages/msrest/pipeline/__init__.py | taharh/label-studio | fab68de11bdc6699472d12a78390375928258e1e | [
"Apache-2.0"
] | 217 | 2016-10-31T22:14:49.000Z | 2022-03-11T15:13:34.000Z | .venv/lib/python3.8/site-packages/msrest/pipeline/__init__.py | taharh/label-studio | fab68de11bdc6699472d12a78390375928258e1e | [
"Apache-2.0"
] | 56 | 2016-10-31T19:01:58.000Z | 2022-02-20T13:04:51.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""),... | 37.045455 | 163 | 0.674356 |
a13d2b2ec1ea75ada8bae14e2ad3490e386eca28 | 9,044 | py | Python | astropy/nddata/tests/test_nduncertainty.py | REMeyer/astropy | 28c49fb618538a01812e586cd07bccdf0591a6c6 | [
"BSD-3-Clause"
] | 3 | 2018-03-20T15:09:16.000Z | 2021-05-27T11:17:33.000Z | astropy/nddata/tests/test_nduncertainty.py | REMeyer/astropy | 28c49fb618538a01812e586cd07bccdf0591a6c6 | [
"BSD-3-Clause"
] | null | null | null | astropy/nddata/tests/test_nduncertainty.py | REMeyer/astropy | 28c49fb618538a01812e586cd07bccdf0591a6c6 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TEST_UNICODE_LITERALS
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pytest
import numpy as np
from numpy.testing import assert_array_equal
from ..nduncertainty import (StdDevUncert... | 36.764228 | 79 | 0.710858 |
48b053aa342e10650adeff937b53461cca9cd8a3 | 2,016 | py | Python | pastebin.py | runrepik/Clover-Edition | c9f0a0fbabf227c81226a70887be18f30bde4d9a | [
"MIT"
] | 7 | 2021-05-01T14:15:31.000Z | 2021-09-11T20:11:45.000Z | pastebin.py | runrepik/Clover-Edition | c9f0a0fbabf227c81226a70887be18f30bde4d9a | [
"MIT"
] | null | null | null | pastebin.py | runrepik/Clover-Edition | c9f0a0fbabf227c81226a70887be18f30bde4d9a | [
"MIT"
] | 1 | 2021-05-14T15:12:26.000Z | 2021-05-14T15:12:26.000Z | from urllib import request, error
import re
import os
from utils import *
from pathlib import Path
fnamesSoFar = {}
def filename(s):
fname = re.sub("-$", "", re.sub("^-", "", re.sub("[^a-zA-Z0-9_-]+", "-", s)))
n = 1
fname2 = fname
while fname2 in fnamesSoFar:
n += 1
fname2 = fname + ... | 35.368421 | 108 | 0.573413 |
08957b041efb1d4e2fcddfcc163e7c5012f500ef | 118,658 | py | Python | tensorflow/python/keras/engine/base_layer.py | where-is-brett/tensorflow | 5da8599b2cf9edfb9fac4431c705501bf7ceccd8 | [
"Apache-2.0"
] | 50 | 2020-03-15T01:04:36.000Z | 2021-11-21T23:25:44.000Z | tensorflow/python/keras/engine/base_layer.py | where-is-brett/tensorflow | 5da8599b2cf9edfb9fac4431c705501bf7ceccd8 | [
"Apache-2.0"
] | 47 | 2020-05-15T11:30:04.000Z | 2021-08-11T16:51:08.000Z | tensorflow/python/keras/engine/base_layer.py | where-is-brett/tensorflow | 5da8599b2cf9edfb9fac4431c705501bf7ceccd8 | [
"Apache-2.0"
] | 66 | 2020-05-15T10:05:12.000Z | 2022-02-14T07:28:18.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.168585 | 111 | 0.681016 |
9e8c8046612a3499c731b94f373e51c44ab9353d | 679 | py | Python | trade_remedies_api/audit/migrations/0003_auto_20181213_1531.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | 1 | 2020-08-13T10:37:15.000Z | 2020-08-13T10:37:15.000Z | trade_remedies_api/audit/migrations/0003_auto_20181213_1531.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | 4 | 2020-09-10T13:41:52.000Z | 2020-12-16T09:00:21.000Z | trade_remedies_api/audit/migrations/0003_auto_20181213_1531.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-12-13 15:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("audit", "0002_auto_20181015_1444"),
]
operations = [
migrations.RenameField(model_name="audit", old_name="case", new_name="case_temp",),
... | 27.16 | 91 | 0.608247 |
5c4aa8f3e567d8fab3d3f1d6901ec8634e8d36d7 | 386 | py | Python | sovrin_client/__metadata__.py | evernym/sovrin-client | 4a0983071f3a44dfc85ac891cc214c1dc18bf161 | [
"Apache-2.0"
] | 1 | 2018-05-27T23:29:02.000Z | 2018-05-27T23:29:02.000Z | sovrin_client/__metadata__.py | evernym/sovrin-client | 4a0983071f3a44dfc85ac891cc214c1dc18bf161 | [
"Apache-2.0"
] | null | null | null | sovrin_client/__metadata__.py | evernym/sovrin-client | 4a0983071f3a44dfc85ac891cc214c1dc18bf161 | [
"Apache-2.0"
] | 2 | 2017-06-03T10:04:00.000Z | 2021-06-06T15:53:32.000Z | """
sovrin-client package metadata
"""
__version_info__ = (0, 2)
__version__ = '.'.join(map(str, __version_info__))
__author__ = "Sovrin Foundation."
__license__ = "Apache 2.0"
__all__ = ['__version_info__', '__version__', '__author__', '__license__']
# TODO: Shouldn't we update these dependencies?
__dependencies__ ... | 22.705882 | 74 | 0.683938 |
a050c16f118f992d1f76b9a39fd90324bed96116 | 12,723 | py | Python | decode_beacon.py | rajkundu/py-decode-beacon | a8c8375d67ed57cacb8dbeda335f4134f6765f18 | [
"MIT"
] | null | null | null | decode_beacon.py | rajkundu/py-decode-beacon | a8c8375d67ed57cacb8dbeda335f4134f6765f18 | [
"MIT"
] | null | null | null | decode_beacon.py | rajkundu/py-decode-beacon | a8c8375d67ed57cacb8dbeda335f4134f6765f18 | [
"MIT"
] | null | null | null | # decode_beacon.py
# Beacon advertisement data decoder
# Copyright (c) 2015 Patrick Van Oosterwijck
# MIT Licensed
#
# For now it only decodes iBeacon and AltBeacon data, it is easily extended
# to support other formats.
# Based on https://github.com/adamf/BLE/blob/master/ble-scanner.py and BlueZ
# source code.
import... | 44.957597 | 144 | 0.661322 |
a6faeb9937b17b323a38ecebf95ad34a90feec3b | 123 | py | Python | reconcile/status.py | tparikh/qontract-reconcile | b4b2c2af69b9b43616b26c60484a6953c4e433e7 | [
"Apache-2.0"
] | null | null | null | reconcile/status.py | tparikh/qontract-reconcile | b4b2c2af69b9b43616b26c60484a6953c4e433e7 | [
"Apache-2.0"
] | null | null | null | reconcile/status.py | tparikh/qontract-reconcile | b4b2c2af69b9b43616b26c60484a6953c4e433e7 | [
"Apache-2.0"
] | null | null | null | class ExitCodes:
SUCCESS = 0
ERROR = 1
DATA_CHANGED = 3
INTEGRATION_NOT_FOUND = 4
FORBIDDEN_SCHEMA = 5
| 17.571429 | 29 | 0.650407 |
5317eede6620d6114e8f1c5dc3bb65efb526dbe2 | 3,652 | py | Python | toscaparser/elements/statefulentitytype.py | santhoshkmr64/santhosh | 1784a6928acb3fb995f479088d26a98ba253757f | [
"Apache-2.0"
] | null | null | null | toscaparser/elements/statefulentitytype.py | santhoshkmr64/santhosh | 1784a6928acb3fb995f479088d26a98ba253757f | [
"Apache-2.0"
] | null | null | null | toscaparser/elements/statefulentitytype.py | santhoshkmr64/santhosh | 1784a6928acb3fb995f479088d26a98ba253757f | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 42.964706 | 78 | 0.641292 |
86c8e522dd8dd8c44ef641e92642f4ae56f4685c | 5,563 | py | Python | tests/test_tokens.py | AndrewBurdyug/makechat | 46c1fc8446b55699c44611fc3b18840be8d1e5cb | [
"Apache-2.0"
] | 3 | 2016-03-07T16:08:51.000Z | 2021-02-27T00:40:44.000Z | tests/test_tokens.py | AndrewBurdyug/makechat | 46c1fc8446b55699c44611fc3b18840be8d1e5cb | [
"Apache-2.0"
] | 5 | 2016-04-22T20:55:16.000Z | 2016-04-22T21:06:35.000Z | tests/test_tokens.py | AndrewBurdyug/makechat | 46c1fc8446b55699c44611fc3b18840be8d1e5cb | [
"Apache-2.0"
] | null | null | null | """All test of auth should be described here."""
import unittest
import falcon
from falcon import testing
from utils import prepare_request, make_request
from makechat.models import User, Token
from makechat.api import setting_up_api
from makechat.api.utils import encrypt_password, session_create
class TestToken(un... | 40.311594 | 78 | 0.636347 |
94ef2b551379f9705c925016c1a897886f7232d0 | 981 | py | Python | tests/unit/story/fake_story_repository.py | hmajid2301/banter-bus-management-api | d51a40c2d5254d4197cbe5bb84aa576df2c24893 | [
"Apache-2.0"
] | null | null | null | tests/unit/story/fake_story_repository.py | hmajid2301/banter-bus-management-api | d51a40c2d5254d4197cbe5bb84aa576df2c24893 | [
"Apache-2.0"
] | null | null | null | tests/unit/story/fake_story_repository.py | hmajid2301/banter-bus-management-api | d51a40c2d5254d4197cbe5bb84aa576df2c24893 | [
"Apache-2.0"
] | null | null | null | from typing import List
from app.story.story_exceptions import StoryExistsException, StoryNotFound
from app.story.story_models import Story
from app.story.story_repository import AbstractStoryRepository
class FakeStoryRepository(AbstractStoryRepository):
def __init__(self, stories: List[Story]):
self.sto... | 31.645161 | 74 | 0.680938 |
2dc151973704ca50fa20800c3d401f6d2e8d3c28 | 303 | py | Python | tests/unit/test_storage.py | HematiteCorp/s3pypi | 2771f52d83290432bdba7acad28394e0e25ef691 | [
"MIT"
] | null | null | null | tests/unit/test_storage.py | HematiteCorp/s3pypi | 2771f52d83290432bdba7acad28394e0e25ef691 | [
"MIT"
] | null | null | null | tests/unit/test_storage.py | HematiteCorp/s3pypi | 2771f52d83290432bdba7acad28394e0e25ef691 | [
"MIT"
] | null | null | null | from s3pypi.package import Package
from s3pypi.storage import S3Storage
def test_secret_in_s3_key(secret):
storage = S3Storage("appstrakt-pypi", secret)
package = Package("test-0.1.0", [])
assert secret in storage._object(package, "index.html").key
assert storage.acl == "public-read"
| 30.3 | 63 | 0.729373 |
630d4fcc33ef5a97cde094c940d212e5372e34ac | 14,676 | py | Python | src/napari_tissuemaps_interface/napari_tissuemaps_interface.py | fractal-napari-plugins-collection/napari_tissuemaps_interface | 4cba72a6193b1853c8534ccecf5fc0ace5202fb3 | [
"BSD-3-Clause"
] | null | null | null | src/napari_tissuemaps_interface/napari_tissuemaps_interface.py | fractal-napari-plugins-collection/napari_tissuemaps_interface | 4cba72a6193b1853c8534ccecf5fc0ace5202fb3 | [
"BSD-3-Clause"
] | null | null | null | src/napari_tissuemaps_interface/napari_tissuemaps_interface.py | fractal-napari-plugins-collection/napari_tissuemaps_interface | 4cba72a6193b1853c8534ccecf5fc0ace5202fb3 | [
"BSD-3-Clause"
] | null | null | null | """
Main module containing the napari widget for reading from a TissueMAPS interface.
"""
import os
from xml.dom import minidom
import json
from typing import List
from io import BytesIO
import dask
from napari_plugin_engine import napari_hook_implementation
import numpy as np
import requests
import PIL
from napari.typ... | 34.942857 | 98 | 0.599959 |
03ccab04b51e63a7172be328f73fd7e6d3e217fe | 3,443 | pyde | Python | villares_bezier_arc_aproximation/villares_bezier_arc_aproximation.pyde | villares/arc_tangents_and_bezier_studies | c7c8978c25286fdf20765e51c5f5cce1df62e410 | [
"BSD-2-Clause"
] | 11 | 2019-05-05T04:46:55.000Z | 2022-03-20T02:36:04.000Z | villares_bezier_arc_aproximation/villares_bezier_arc_aproximation.pyde | villares/arc_tangents_and_bezier_studies | c7c8978c25286fdf20765e51c5f5cce1df62e410 | [
"BSD-2-Clause"
] | null | null | null | villares_bezier_arc_aproximation/villares_bezier_arc_aproximation.pyde | villares/arc_tangents_and_bezier_studies | c7c8978c25286fdf20765e51c5f5cce1df62e410 | [
"BSD-2-Clause"
] | null | null | null | """
Written by Alexandre B A Villares for Processing Python Mode
Based on Golan Levin's approximating a circular arc with a cubic Bezier curve.
http://www.flong.com/blog/2009/bezier-approximation-of-a-circular-arc-in-processing/
"""
DEBUG = False
radius = 300 # radius of the circular arc
cx = 340 # center of th... | 34.777778 | 90 | 0.563172 |
1bd524e4e794a33703823cd146165dd10e013f14 | 302 | py | Python | src/ralph_scrooge/tests/plugins/collect/samples/ceilometer.py | xliiv/ralph_pricing | 88a295b6f0af66ae03c145205ada99f17ab51dd0 | [
"Apache-2.0"
] | null | null | null | src/ralph_scrooge/tests/plugins/collect/samples/ceilometer.py | xliiv/ralph_pricing | 88a295b6f0af66ae03c145205ada99f17ab51dd0 | [
"Apache-2.0"
] | null | null | null | src/ralph_scrooge/tests/plugins/collect/samples/ceilometer.py | xliiv/ralph_pricing | 88a295b6f0af66ae03c145205ada99f17ab51dd0 | [
"Apache-2.0"
] | 1 | 2021-11-15T21:21:17.000Z | 2021-11-15T21:21:17.000Z | SAMPLE_CEILOMETER = [
('12345', 123, 'instance:i1'),
('12345', 321, 'instance:i2'),
('54321', 123, 'instance:i1'),
('54321', 321, 'instance:i2'),
('12345', 123, 'instance:i3'),
('09876', 123, 'instance:i1'),
('67899', 123, 'instance:i1'),
('665', 123, 'instance:i1'),
]
| 27.454545 | 34 | 0.52649 |
1addd6c100bc03126b8660d56999cacd1508ed73 | 1,738 | py | Python | examples/pytest/test_demo.py | vinokurov/snapshottest | 0b4656a156b22221674dd4c1233c849bb03e28f3 | [
"MIT"
] | 1 | 2019-05-27T20:20:49.000Z | 2019-05-27T20:20:49.000Z | examples/pytest/test_demo.py | vinokurov/snapshottest | 0b4656a156b22221674dd4c1233c849bb03e28f3 | [
"MIT"
] | 2 | 2019-02-07T20:52:00.000Z | 2019-02-11T14:19:58.000Z | examples/pytest/test_demo.py | vinokurov/snapshottest | 0b4656a156b22221674dd4c1233c849bb03e28f3 | [
"MIT"
] | 2 | 2021-03-08T12:01:00.000Z | 2021-03-09T08:13:59.000Z | # -*- coding: utf-8 -*-
from snapshottest.file import FileSnapshot
def api_client_get(url):
return {
'url': url,
}
def test_me_endpoint(snapshot):
"""Testing the API for /me"""
my_api_response = api_client_get('/me')
snapshot.assert_match(my_api_response)
def test_unicode(snapshot):
... | 28.491803 | 115 | 0.693901 |
acc87437dc8bf5f1ca55a575966b77025a41d9fa | 10,600 | py | Python | inner_loop.py | pranavajitnair/Metalearning-for-POS-tagging-PyTorch | b8d06532cff771becd823fa38aa27327d8ced214 | [
"MIT"
] | 7 | 2020-06-01T01:53:18.000Z | 2021-07-06T18:43:11.000Z | inner_loop.py | pranavajitnair/Metalearning-for-POS-tagging-PyTorch | b8d06532cff771becd823fa38aa27327d8ced214 | [
"MIT"
] | null | null | null | inner_loop.py | pranavajitnair/Metalearning-for-POS-tagging-PyTorch | b8d06532cff771becd823fa38aa27327d8ced214 | [
"MIT"
] | 1 | 2020-11-04T01:30:16.000Z | 2020-11-04T01:30:16.000Z | import torch
import torch.nn as nn
from collections import OrderedDict
class CRF_BiLSTM(nn.Module):
def __init__(self,epochs,h_size,n_tokens,token_dict,char_dict,n_chars):
super(CRF_BiLSTM,self).__init__()
self.h_size=h_size
self.n_... | 44.537815 | 139 | 0.495755 |
82f59b3259715dbadfc29f422bbb05f7c2c4c22a | 5,096 | py | Python | os_utilities/utils.py | rsomani95/os_utilities | 188b98998c5d215acac5137a5d2b1af75d9efe65 | [
"Apache-2.0"
] | null | null | null | os_utilities/utils.py | rsomani95/os_utilities | 188b98998c5d215acac5137a5d2b1af75d9efe65 | [
"Apache-2.0"
] | 1 | 2021-09-28T05:33:47.000Z | 2021-09-28T05:33:47.000Z | os_utilities/utils.py | rsomani95/os_utilities | 188b98998c5d215acac5137a5d2b1af75d9efe65 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/utils.ipynb (unless otherwise specified).
__all__ = ['PathLike', 'ListOfPaths', 'ListOfStrings', 'ls', 'listdirs', 'get_files', 'get_image_files',
'get_video_files', 'image_extensions', 'video_extensions', 'flatten', 'mkdir', 'uniqueify', 'clean_filename']
# ... | 38.606061 | 129 | 0.636381 |
981db1f8789405af3be98ad8f26d7cd0b3d623a3 | 24,034 | py | Python | src/api-service/__app__/onefuzzlib/workers/scalesets.py | isabella232/onefuzz | 2bec9db8289d194adff519ca2c8d5d2c77be7f9e | [
"MIT"
] | null | null | null | src/api-service/__app__/onefuzzlib/workers/scalesets.py | isabella232/onefuzz | 2bec9db8289d194adff519ca2c8d5d2c77be7f9e | [
"MIT"
] | 1 | 2021-03-03T11:06:24.000Z | 2021-03-03T11:06:24.000Z | src/api-service/__app__/onefuzzlib/workers/scalesets.py | isabella232/onefuzz | 2bec9db8289d194adff519ca2c8d5d2c77be7f9e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import datetime
import logging
from typing import Any, Dict, List, Optional, Tuple, Union
from uuid import UUID, uuid4
from onefuzztypes.enums import ErrorCode, NodeState, PoolState, ScalesetState
from onefuzztypes.events... | 32.478378 | 118 | 0.557335 |
3d9067b4b75fbc1e740e7a775e3115f63409c81b | 493 | py | Python | unidade/migrations/0002_auto_20170503_1822.py | Bleno/sisgestor-django | c35f76eafc3e51afb99c84245e01881cef43aa5b | [
"MIT"
] | 1 | 2017-04-27T19:26:49.000Z | 2017-04-27T19:26:49.000Z | unidade/migrations/0002_auto_20170503_1822.py | Bleno/sisgestor-django | c35f76eafc3e51afb99c84245e01881cef43aa5b | [
"MIT"
] | null | null | null | unidade/migrations/0002_auto_20170503_1822.py | Bleno/sisgestor-django | c35f76eafc3e51afb99c84245e01881cef43aa5b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-03 18:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('unidade', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 23.47619 | 108 | 0.628803 |
2557c7bcc28d655d9419f397bcdd767eb27d901d | 517 | py | Python | config/wsgi.py | sirdesmond09/predict | 80d028a26450c09721ba3d6f351b2cd1c5b5b0f8 | [
"MIT",
"Unlicense"
] | null | null | null | config/wsgi.py | sirdesmond09/predict | 80d028a26450c09721ba3d6f351b2cd1c5b5b0f8 | [
"MIT",
"Unlicense"
] | null | null | null | config/wsgi.py | sirdesmond09/predict | 80d028a26450c09721ba3d6f351b2cd1c5b5b0f8 | [
"MIT",
"Unlicense"
] | null | null | null | """
WSGI config for config 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/3.0/howto/deployment/wsgi/
"""
import os
configuration = os.getenv('ENVIRONMENT', 'development').title()
os.environ.setdefault('... | 27.210526 | 78 | 0.791103 |
40e9f91a285228df445727a7983d69c50dc8d285 | 9,150 | py | Python | curiefense/curietasker/curietasker/tasks_list_updates.py | tzuryby/curiefense | 4b7a92cb907345ecf9faeab1adf88b46f8d6c3a3 | [
"Apache-2.0"
] | 1 | 2021-06-28T07:32:48.000Z | 2021-06-28T07:32:48.000Z | curiefense/curietasker/curietasker/tasks_list_updates.py | tzuryby/curiefense | 4b7a92cb907345ecf9faeab1adf88b46f8d6c3a3 | [
"Apache-2.0"
] | 2 | 2021-05-06T15:58:57.000Z | 2021-05-09T13:43:11.000Z | curiefense/curietasker/curietasker/tasks_list_updates.py | tzuryby/curiefense | 4b7a92cb907345ecf9faeab1adf88b46f8d6c3a3 | [
"Apache-2.0"
] | null | null | null | import time
import datetime
import requests
import json
import re
from jsonschema import validate, ValidationError
from .task import Task
SCHEMAFILE = "/tag-rules.schema"
@Task.register("update")
class TaskUpdate(Task):
parsers = {
# "ip": re.compile("^(?P<val>(([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9... | 36.023622 | 167 | 0.462404 |
e547b826b5dd4133376bd791831d268e00b72160 | 3,516 | py | Python | lenstest/lenstest.py | scottprahl/lenstest | 396946a39be7ea6479aff28f55fe3ee17ea82a48 | [
"MIT"
] | 1 | 2022-03-04T14:19:35.000Z | 2022-03-04T14:19:35.000Z | lenstest/lenstest.py | scottprahl/lenstest | 396946a39be7ea6479aff28f55fe3ee17ea82a48 | [
"MIT"
] | null | null | null | lenstest/lenstest.py | scottprahl/lenstest | 396946a39be7ea6479aff28f55fe3ee17ea82a48 | [
"MIT"
] | null | null | null | # pylint: disable=invalid-name
"""
Utility routines for lens testing.
Documentation and examples are available at <https://lenstest.readthedocs.io>
"""
import numpy as np
import matplotlib.pyplot as plt
__all__ = ('XY_test_points',
'knife_polygon',
'circle_polygon',
'draw_circle',
... | 29.79661 | 77 | 0.578783 |
481d612cc35af788c3dade328300a599a47363b6 | 1,508 | py | Python | wolfbot/solvers/switching.py | TylerYep/wolfbot | 8d4786ce9542bab344b227e0571bb24bc354298d | [
"MIT"
] | 3 | 2018-06-16T00:03:30.000Z | 2021-12-26T20:48:45.000Z | wolfbot/solvers/switching.py | TylerYep/wolfbot | 8d4786ce9542bab344b227e0571bb24bc354298d | [
"MIT"
] | null | null | null | wolfbot/solvers/switching.py | TylerYep/wolfbot | 8d4786ce9542bab344b227e0571bb24bc354298d | [
"MIT"
] | 2 | 2021-03-03T09:31:35.000Z | 2021-03-03T10:02:55.000Z | from __future__ import annotations
from wolfbot.solvers.state import SolverState
from wolfbot.statements import Statement
def switching_solver(
statements: tuple[Statement, ...], known_true: tuple[int, ...] = ()
) -> list[SolverState]:
"""
Returns maximal list of statements that can be true from a list
... | 33.511111 | 74 | 0.653846 |
bdfc372bacf416b31d4a67d46b49f447da1cfa96 | 3,384 | py | Python | src/modules/converter/xml/acunetix.py | nullsecuritynet/appvulnms | 306be6f123de95685a8e27b368534de8b27e7b38 | [
"MIT"
] | 1 | 2015-02-02T23:53:36.000Z | 2015-02-02T23:53:36.000Z | src/modules/converter/xml/acunetix.py | nullsecuritynet/appvulnms | 306be6f123de95685a8e27b368534de8b27e7b38 | [
"MIT"
] | null | null | null | src/modules/converter/xml/acunetix.py | nullsecuritynet/appvulnms | 306be6f123de95685a8e27b368534de8b27e7b38 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: victor
# @Date: 2014-01-10
# @Last Modified by: victor
# @Last Modified time: 2014-06-06
# @Copyright:
#
# This file is part of the AppVulnMS project.
#
#
# Copyright (c) 2014 Victor Dorneanu <info AAET dornea DOT nu>
#
# Permission is hereby granted... | 33.84 | 93 | 0.648936 |
8f888d5afd7b500c67effe110d2ae71ab1746bcc | 9,222 | py | Python | ckan/tests/lib/test_jobs.py | qld-gov-au/ckan | f2524f9029e62cfb8014159d261e5b62625bd9dd | [
"Apache-2.0"
] | null | null | null | ckan/tests/lib/test_jobs.py | qld-gov-au/ckan | f2524f9029e62cfb8014159d261e5b62625bd9dd | [
"Apache-2.0"
] | 16 | 2020-03-18T00:18:23.000Z | 2021-09-15T04:54:35.000Z | ckan/tests/lib/test_jobs.py | qld-gov-au/ckan | f2524f9029e62cfb8014159d261e5b62625bd9dd | [
"Apache-2.0"
] | 1 | 2021-05-09T23:10:13.000Z | 2021-05-09T23:10:13.000Z | # encoding: utf-8
u'''
Tests for ``ckan.lib.jobs``.
'''
import datetime
from nose.tools import ok_, assert_equal, raises, assert_false
import rq
import ckan.lib.jobs as jobs
from ckan.common import config
from ckan.logic import NotFound
from ckan import model
from ckan.tests.helpers import (call_action, changed_co... | 33.534545 | 79 | 0.629907 |
86872d6384f527581cdf578fe2c5378b14223cd9 | 2,491 | py | Python | another-seq.py | TimNicholsonShaw/AnOThER-Seq | 57a9ac11190eb94ce0f0a54bcbecb660c70dd24a | [
"MIT"
] | null | null | null | another-seq.py | TimNicholsonShaw/AnOThER-Seq | 57a9ac11190eb94ce0f0a54bcbecb660c70dd24a | [
"MIT"
] | null | null | null | another-seq.py | TimNicholsonShaw/AnOThER-Seq | 57a9ac11190eb94ce0f0a54bcbecb660c70dd24a | [
"MIT"
] | null | null | null | import counter, aligner,sys, tools
########################################################################################################################
if __name__ == "__main__":
database = "superset_withtRNA.fa"
name = "output"
allowedmismatch = 1
help = """
Performs the computationally ... | 42.948276 | 120 | 0.647933 |
1ca1853ab4b0762c5ba7747d6351de0480c4a659 | 69,861 | py | Python | a10sdk/core/gslb/gslb.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 16 | 2015-05-20T07:26:30.000Z | 2021-01-23T11:56:57.000Z | a10sdk/core/gslb/gslb.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 6 | 2015-03-24T22:07:11.000Z | 2017-03-28T21:31:18.000Z | a10sdk/core/gslb/gslb.py | deepfield/a10sdk-python | bfaa58099f51f085d5e91652d1d1a3fd5c529d5d | [
"Apache-2.0"
] | 23 | 2015-03-29T15:43:01.000Z | 2021-06-02T17:12:01.000Z | from a10sdk.common.A10BaseClass import A10BaseClass
class GslbIpListAddrList(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param ip: {"type": "string", "description": "Specify IP address", "format": "ipv4-address"}
:param ip_mask: {"type": "string", "description":... | 640.926606 | 23,719 | 0.641331 |
8e356bc70359dfb2cbbae76ad3d60f36378ad5f8 | 4,962 | py | Python | accounts/apps/stores.py | cnds/wxdemo | a445ea19ccd0b47caf6ea94e1ddec2ce3faf7d5e | [
"MIT"
] | null | null | null | accounts/apps/stores.py | cnds/wxdemo | a445ea19ccd0b47caf6ea94e1ddec2ce3faf7d5e | [
"MIT"
] | null | null | null | accounts/apps/stores.py | cnds/wxdemo | a445ea19ccd0b47caf6ea94e1ddec2ce3faf7d5e | [
"MIT"
] | null | null | null | from bson import ObjectId
from flask import jsonify, request
from jybase.utils import create_md5_key, create_hash_key
from .base import Base
from .json_validate import SCHEMA
from config import config
class Stores(Base):
def get(self):
# TODO: need to optimize the way of checking query params
p... | 32.431373 | 81 | 0.576784 |
5f1c08f3f10e18dd8e7dff390f3fc2d4694c6bdd | 3,019 | py | Python | src/soomgogather/naver/statreport.py | Soomgo-Platform/soomgo-gather | 6713d45b9768f88e8932eccd4c14ff0021c68998 | [
"MIT"
] | 3 | 2021-12-13T03:03:21.000Z | 2021-12-23T06:09:52.000Z | src/soomgogather/naver/statreport.py | Soomgo-Platform/soomgo-gather | 6713d45b9768f88e8932eccd4c14ff0021c68998 | [
"MIT"
] | 6 | 2021-12-07T08:21:40.000Z | 2022-03-30T04:43:26.000Z | src/soomgogather/naver/statreport.py | Soomgo-Platform/soomgo-gather | 6713d45b9768f88e8932eccd4c14ff0021c68998 | [
"MIT"
] | null | null | null | from marshmallow import Schema, ValidationError, fields, validate
from ._searchad import BaseSearchAD
class StatReport(BaseSearchAD):
"""Naver SearchAd API StatReport
Naver SearchAd API에서 발급받은 api_key, secret_key, customer_id를 사용하여 StatReport 클래스 객체를 생성한다.
생성한 StatReport 객체로 대용량 보고서 기능을 이용하여 특정일에 발생한 대용... | 30.494949 | 97 | 0.60583 |
a7ea2811932426fc381cce9f3902b16c953a8fcd | 7,596 | py | Python | mmf/datasets/multi_dataset_loader.py | san2597/mmf | c0812e9281c6e679cb7f00af78a5eda267820aab | [
"BSD-3-Clause"
] | 2 | 2021-02-22T12:15:42.000Z | 2021-05-02T15:22:24.000Z | mmf/datasets/multi_dataset_loader.py | san2597/mmf | c0812e9281c6e679cb7f00af78a5eda267820aab | [
"BSD-3-Clause"
] | 7 | 2021-03-01T21:16:26.000Z | 2022-02-27T07:07:11.000Z | mmf/datasets/multi_dataset_loader.py | krantirk/MMF | 2e4acaad7ca8eee4319e1205a560eed81733a0be | [
"BSD-3-Clause"
] | 1 | 2022-03-04T14:19:43.000Z | 2022-03-04T14:19:43.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
"""
MultiDatasetLoader class is used by DatasetLoader class to load multiple datasets
and more granular
"""
import sys
import numpy as np
import torch
from mmf.common.registry import registry
from mmf.utils.build import build_dataloader_and_sampler, build_dataset
fr... | 30.262948 | 88 | 0.622038 |
05c1f4753e2d1829fd253c04bc8e61a9a2b4ec92 | 1,748 | py | Python | geometry.py | git-audo/poli-renderer | 31a8b8d26361451f3e39a0e79afb907939a0e06e | [
"MIT"
] | null | null | null | geometry.py | git-audo/poli-renderer | 31a8b8d26361451f3e39a0e79afb907939a0e06e | [
"MIT"
] | null | null | null | geometry.py | git-audo/poli-renderer | 31a8b8d26361451f3e39a0e79afb907939a0e06e | [
"MIT"
] | null | null | null | import math
class Point2D:
def __init__(self, id, x, y):
self.id = id
self.x = x
self.y = y
def getById(id, points):
point = [ p for p in points if p.id == id ]
return point[0]
class Point(Point2D):
def __init__(self, id, a, b, c):
Point2D.__init__(sel... | 23 | 74 | 0.484554 |
483670921befd2f71314843e8fa176046b923c86 | 472 | py | Python | chatbot/model/message.py | aminzai/linebot | 3b0805a710ce11e4cd3afb76859c3be9c18a9d91 | [
"BSD-3-Clause"
] | 1 | 2018-05-14T13:08:12.000Z | 2018-05-14T13:08:12.000Z | chatbot/model/message.py | aminzai/linebot | 3b0805a710ce11e4cd3afb76859c3be9c18a9d91 | [
"BSD-3-Clause"
] | null | null | null | chatbot/model/message.py | aminzai/linebot | 3b0805a710ce11e4cd3afb76859c3be9c18a9d91 | [
"BSD-3-Clause"
] | null | null | null | from chatbot.model import Base
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import DateTime
class Message(Base):
__tablename__ = 'messages'
idx = Column(Integer, primary_key=True)
id = Column(String)
uid = Column(Integer)
text = Colum... | 22.47619 | 43 | 0.71822 |
907aaf974a230041e9d3c7746e5eea4396631577 | 10,060 | py | Python | tests/forte/data/ontology/ontology_code_generator_test.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | 2 | 2021-01-01T12:07:27.000Z | 2021-09-10T03:57:18.000Z | tests/forte/data/ontology/ontology_code_generator_test.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | tests/forte/data/ontology/ontology_code_generator_test.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Forte 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 applicable ... | 41.570248 | 80 | 0.650795 |
22744e18b0733869b21373daa5c14bb1478cc2c9 | 69,417 | py | Python | Lib/logging/__init__.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | 21 | 2021-01-10T16:44:55.000Z | 2022-03-03T13:15:07.000Z | Lib/logging/__init__.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | 3 | 2021-01-10T15:38:50.000Z | 2021-04-29T09:45:47.000Z | Lib/logging/__init__.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | 1 | 2021-01-10T15:07:38.000Z | 2021-01-10T15:07:38.000Z | # Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | 35.434916 | 89 | 0.591008 |
db8f7170dc283484ed159072fa77f681e9095c78 | 2,612 | py | Python | process_micromet/merge_hq_reservoir.py | peisabelle/EVAP_data_worflow | 9b1b2ea1fbc35173ce31ed21c53b9271804fc5cb | [
"BSD-2-Clause"
] | 2 | 2021-01-15T21:19:21.000Z | 2021-01-29T23:52:04.000Z | process_micromet/merge_hq_reservoir.py | peisabelle/EVAP_data_worflow | 9b1b2ea1fbc35173ce31ed21c53b9271804fc5cb | [
"BSD-2-Clause"
] | 1 | 2021-01-29T23:58:41.000Z | 2021-02-01T14:48:33.000Z | process_micromet/merge_hq_reservoir.py | peisabelle/EVAP_data_worflow | 9b1b2ea1fbc35173ce31ed21c53b9271804fc5cb | [
"BSD-2-Clause"
] | 2 | 2021-01-15T21:20:34.000Z | 2021-01-22T14:53:25.000Z | # -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import os
def merge_hq_reservoir(dates, extDataDir, mergedCsvOutDir):
""" Merge and format streamflow and level data provided by Hydro-Québec
The external data directory should contain the following two files
extDataDir
|-- HQ_débits.xlsx... | 29.681818 | 98 | 0.64242 |
2e74048998380b7a68af7d284daa9f09c7211d2c | 841 | py | Python | sparseklearn/fastLA/__init__.py | EricKightley/sparseklearn | d5d1f42c0572972ea3f4702734f82066ae7270e3 | [
"MIT"
] | 3 | 2018-02-08T08:35:54.000Z | 2020-02-19T21:50:28.000Z | sparseklearn/fastLA/__init__.py | EricKightley/sparseklearn | d5d1f42c0572972ea3f4702734f82066ae7270e3 | [
"MIT"
] | 1 | 2020-07-07T05:23:52.000Z | 2020-07-08T13:57:48.000Z | sparseklearn/fastLA/__init__.py | EricKightley/sparseklearn | d5d1f42c0572972ea3f4702734f82066ae7270e3 | [
"MIT"
] | 1 | 2019-10-07T03:56:41.000Z | 2019-10-07T03:56:41.000Z | from .fastLA import dist_both_comp
from .fastLA import dist_one_comp_one_full
from .fastLA import pairwise_l2_distances_with_self
from .fastLA import pairwise_l2_distances_with_full
from .fastLA import mahalanobis_distance_spherical
from .fastLA import mahalanobis_distance_diagonal
from .fastLA import pairwise_mahalano... | 44.263158 | 66 | 0.902497 |
4d8cf35d25571160430097964570af6a480d69b3 | 403 | py | Python | backend/testapp_32212/wsgi.py | crowdbotics-apps/testapp-32212 | 7be7ba410a7713905a02f9a24bfaa2600d596eb0 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/testapp_32212/wsgi.py | crowdbotics-apps/testapp-32212 | 7be7ba410a7713905a02f9a24bfaa2600d596eb0 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/testapp_32212/wsgi.py | crowdbotics-apps/testapp-32212 | 7be7ba410a7713905a02f9a24bfaa2600d596eb0 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for testapp_32212 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.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... | 23.705882 | 78 | 0.791563 |
aba7f18ce44d4bc0007df503a44d19de1b44a2da | 5,104 | py | Python | test/functional/test_framework/netutil.py | fakecoinbase/UbiStateslashubicoin | 42216bd49a34e5802839dbfb405bac6fade12814 | [
"MIT"
] | 7 | 2020-05-11T11:17:49.000Z | 2021-05-29T09:04:11.000Z | test/functional/test_framework/netutil.py | fakecoinbase/UbiStateslashubicoin | 42216bd49a34e5802839dbfb405bac6fade12814 | [
"MIT"
] | null | null | null | test/functional/test_framework/netutil.py | fakecoinbase/UbiStateslashubicoin | 42216bd49a34e5802839dbfb405bac6fade12814 | [
"MIT"
] | 14 | 2020-04-27T11:09:01.000Z | 2021-12-16T18:49:38.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Linux network utilities.
Roughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-1... | 32.303797 | 111 | 0.600705 |
c58e9503d20750b72f75e461deec973ed5cd6279 | 51 | py | Python | Modulos/Criptografia/__init__.py | Jonatan966/SODA | 046d8c1e7b9bac3a555526c9fe2f365c2b338aca | [
"MIT"
] | null | null | null | Modulos/Criptografia/__init__.py | Jonatan966/SODA | 046d8c1e7b9bac3a555526c9fe2f365c2b338aca | [
"MIT"
] | null | null | null | Modulos/Criptografia/__init__.py | Jonatan966/SODA | 046d8c1e7b9bac3a555526c9fe2f365c2b338aca | [
"MIT"
] | null | null | null | from .Scrt_Cesar import *
from .Scrt_Fence import * | 25.5 | 25 | 0.784314 |
31d002a8430d3d78bdcfb0de471f49f49c0b5f67 | 6,765 | py | Python | fastertransformer/xlnet/python/runProfile.py | dujiangsu/FasterTransformer | 0648b8839be02eafba1cdba511a41b4fd13e2c9e | [
"Apache-2.0"
] | 777 | 2021-04-05T07:45:07.000Z | 2022-03-31T20:40:00.000Z | fastertransformer/xlnet/python/runProfile.py | dujiangsu/FasterTransformer | 0648b8839be02eafba1cdba511a41b4fd13e2c9e | [
"Apache-2.0"
] | 119 | 2021-04-05T08:31:18.000Z | 2022-03-31T04:50:25.000Z | fastertransformer/xlnet/python/runProfile.py | dujiangsu/FasterTransformer | 0648b8839be02eafba1cdba511a41b4fd13e2c9e | [
"Apache-2.0"
] | 135 | 2021-04-05T09:12:42.000Z | 2022-03-31T09:36:58.000Z | # Copyright (c) 2019, 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 may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.175115 | 127 | 0.630155 |
a1d6ce0a78df30a2fd0457d754a4bd94d04f4401 | 220 | py | Python | examples/discover.py | jraynor910/SmartHome | 1997d1e8cdde4fe15696488c9f35dd3e25851e0b | [
"MIT"
] | null | null | null | examples/discover.py | jraynor910/SmartHome | 1997d1e8cdde4fe15696488c9f35dd3e25851e0b | [
"MIT"
] | null | null | null | examples/discover.py | jraynor910/SmartHome | 1997d1e8cdde4fe15696488c9f35dd3e25851e0b | [
"MIT"
] | null | null | null | import logging
from pprint import pprint as pp
from pyHS100 import TPLinkSmartHomeProtocol
logging.basicConfig(level=logging.DEBUG)
for dev in TPLinkSmartHomeProtocol.discover():
print("Found device!")
pp(dev)
| 22 | 46 | 0.790909 |
fc95fff641964ca1e30c5e680af221badecb042d | 406 | py | Python | demos.py | biergeliebter/Intro_to_Python | 3814cf9d6b95951d5784e747989412266168be85 | [
"MIT"
] | null | null | null | demos.py | biergeliebter/Intro_to_Python | 3814cf9d6b95951d5784e747989412266168be85 | [
"MIT"
] | 1 | 2019-10-04T20:45:49.000Z | 2019-10-04T20:45:49.000Z | demos.py | biergeliebter/Intro_to_Python | 3814cf9d6b95951d5784e747989412266168be85 | [
"MIT"
] | null | null | null | # Ctrl+K+C to comment a line, Ctrl+K+U to uncomment a line
first_name = input("What is your first name? ")
last_name = input("What is your last name? ")
print("Hello " + first_name.capitalize() + " " + last_name.capitalize())
print()
# output = "Hello, {} {}".format(first_name, last_name)
# output = "Hello, {1} {0}".f... | 40.6 | 72 | 0.684729 |
fa3463253ebb19b43d0314fe5a57527623438348 | 898 | py | Python | features/implementation/proc_check.py | ZenDevelopmentEcosystem/FileSet | 8ff2e64356e4e3731d66ea74402a3522464fb7ee | [
"Apache-2.0"
] | null | null | null | features/implementation/proc_check.py | ZenDevelopmentEcosystem/FileSet | 8ff2e64356e4e3731d66ea74402a3522464fb7ee | [
"Apache-2.0"
] | null | null | null | features/implementation/proc_check.py | ZenDevelopmentEcosystem/FileSet | 8ff2e64356e4e3731d66ea74402a3522464fb7ee | [
"Apache-2.0"
] | null | null | null | import re
from pytest_bdd import parsers, then
@then(parsers.parse('exit code {exit_code:d}'))
def check_exit_code(exit_code, proc_status):
assert proc_status.exitcode == exit_code, proc_status.output()
@then('no output')
def check_no_output(proc_status):
assert proc_status.output() == '', proc_status.outp... | 33.259259 | 92 | 0.747216 |
916eabfa72609ff55117d8b85e292c9f0438aa22 | 19,241 | py | Python | tableschema/schema.py | datapackages/jsontableschema-py | 7b9363903db25409ca16bd1539d8f5df4925c077 | [
"MIT"
] | 224 | 2017-04-11T11:29:48.000Z | 2022-03-26T18:34:50.000Z | tableschema/schema.py | frictionlessdata/tableschema-py | 7b9363903db25409ca16bd1539d8f5df4925c077 | [
"MIT"
] | 111 | 2017-03-28T19:02:01.000Z | 2021-12-20T08:42:21.000Z | tableschema/schema.py | okfn/json-table-schema-py | 7b9363903db25409ca16bd1539d8f5df4925c077 | [
"MIT"
] | 40 | 2017-04-01T08:21:57.000Z | 2021-02-28T23:52:07.000Z | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import io
import six
import json
from collections import OrderedDict
from copy import deepcopy
from six.moves import zip_longest
from .profile imp... | 31.490998 | 102 | 0.578556 |
c046f63f360238414544972198a171e98bad6a3a | 3,851 | py | Python | hpc_acm/models/node_metrics_data.py | coin8086/hpc_acm | d8514339175ac097e83a6203daab1f0314c5dde8 | [
"MIT"
] | 2 | 2019-04-26T03:02:37.000Z | 2020-06-01T14:25:37.000Z | hpc_acm/models/node_metrics_data.py | coin8086/hpc_acm | d8514339175ac097e83a6203daab1f0314c5dde8 | [
"MIT"
] | 2 | 2019-06-19T02:33:54.000Z | 2019-06-25T02:54:36.000Z | hpc_acm/models/node_metrics_data.py | coin8086/hpc_acm | d8514339175ac097e83a6203daab1f0314c5dde8 | [
"MIT"
] | 2 | 2019-06-18T04:29:10.000Z | 2021-01-10T10:02:02.000Z | # coding: utf-8
"""
HPC Web API
Preview # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from hpc_acm.models.node_metrics_metric_items import NodeMetricsMetricItems # noqa: F401,E5... | 26.93007 | 94 | 0.574656 |
e535ea14b2a7cddc55bf3b89738919bd50150398 | 1,383 | py | Python | tests/integration/aliases/python/retype_component/step2/__main__.py | CDMiXer/Woolloomooloo | 62272b869dbc0190fd20540607b33f3edeba9dce | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/integration/aliases/python/retype_component/step2/__main__.py | CDMiXer/Woolloomooloo | 62272b869dbc0190fd20540607b33f3edeba9dce | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/integration/aliases/python/retype_component/step2/__main__.py | CDMiXer/Woolloomooloo | 62272b869dbc0190fd20540607b33f3edeba9dce | [
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2016-2018, Pulumi Corporation. All rights reserved.
import copy
from pulumi import Alias, ComponentResource, export, Resource, ResourceOptions, create_urn, ROOT_STACK_RESOURCE
class Resource1(ComponentResource):
def __init__(self, name, opts=None):/* ARMv5 bot in Release mode */
super().__in... | 46.1 | 141 | 0.706435 |
9bcca0dde66c9d493d049e6c4a09ba91bd6eba47 | 21,895 | py | Python | mmdet/datasets/coco.py | AIForcesProPTIT/mmdet | 786ed5702dd4df8b15b7a11df7bb4907e1289e53 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/coco.py | AIForcesProPTIT/mmdet | 786ed5702dd4df8b15b7a11df7bb4907e1289e53 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/coco.py | AIForcesProPTIT/mmdet | 786ed5702dd4df8b15b7a11df7bb4907e1289e53 | [
"Apache-2.0"
] | null | null | null | import itertools
import logging
import os.path as osp
import tempfile
from collections import OrderedDict
import mmcv
import numpy as np
from mmcv.utils import print_log
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
from terminaltables import AsciiTable
from mmdet.core import eval_recall... | 40.697026 | 88 | 0.530852 |
378d52822e055d98cd9d8b16648c601e4e585074 | 3,016 | py | Python | plugins/modules/sda_auth_profile.py | robertcsapo/dnacenter-ansible | 33f776f8c0bc7113da73191c301dd1807e6b4a43 | [
"MIT"
] | null | null | null | plugins/modules/sda_auth_profile.py | robertcsapo/dnacenter-ansible | 33f776f8c0bc7113da73191c301dd1807e6b4a43 | [
"MIT"
] | null | null | null | plugins/modules/sda_auth_profile.py | robertcsapo/dnacenter-ansible | 33f776f8c0bc7113da73191c301dd1807e6b4a43 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r"""
---
module: sda_auth_profile
short_description: Manage SdaAuthProfile objects of Sda
description:
- Add default authenticatio... | 29.861386 | 101 | 0.744695 |
9551b5b46447cdf0c0e2c7769d12185520d712e4 | 2,325 | py | Python | nseta/scanner/liveStockScanner.py | pkjmesra/nseta | 28cd8cede465efe9f506a38c5933602c463e5185 | [
"MIT"
] | 8 | 2020-10-12T02:59:03.000Z | 2022-03-20T15:06:50.000Z | nseta/scanner/liveStockScanner.py | pkjmesra/nseta | 28cd8cede465efe9f506a38c5933602c463e5185 | [
"MIT"
] | 3 | 2020-10-13T16:30:09.000Z | 2021-01-07T23:57:05.000Z | nseta/scanner/liveStockScanner.py | pkjmesra/nseta | 28cd8cede465efe9f506a38c5933602c463e5185 | [
"MIT"
] | 5 | 2020-10-12T14:57:41.000Z | 2021-12-30T11:52:34.000Z | # -*- coding: utf-8 -*-
import pandas as pd
import talib as ta
from nseta.live.live import get_live_quote
from nseta.resources.resources import *
from nseta.scanner.baseStockScanner import baseStockScanner
from nseta.archives.archiver import *
from nseta.common.log import tracelog, default_logger
__all__ = ['liveStoc... | 38.75 | 173 | 0.634409 |
ed27bced547d6f374515a0ae264172ab835f91c8 | 1,126 | py | Python | api/serializers.py | alessandrobogliolo/coding-events | 9e34a937c4503f8fb6e406142bd4ef43075ad6dc | [
"MIT"
] | 9 | 2015-01-21T21:37:57.000Z | 2017-10-13T07:27:49.000Z | api/serializers.py | alessandrobogliolo/coding-events | 9e34a937c4503f8fb6e406142bd4ef43075ad6dc | [
"MIT"
] | 58 | 2015-04-30T11:01:56.000Z | 2017-11-05T19:23:43.000Z | api/serializers.py | alessandrobogliolo/coding-events | 9e34a937c4503f8fb6e406142bd4ef43075ad6dc | [
"MIT"
] | 17 | 2015-08-15T14:59:29.000Z | 2020-06-25T05:20:47.000Z | from django.utils.text import Truncator
from rest_framework import serializers
from api.models.events import Event
class EventListSerializers(serializers.ModelSerializer):
description_short = serializers.CharField(source='description')
class Meta:
model = Event
fields = (
'geopos... | 26.186047 | 67 | 0.652753 |
8198eb45a59f40bca8b8d62ae4f51e6b013f5d9e | 1,812 | py | Python | nnformer/utilities/folder_names.py | BRAIN-Lab-UNC/BrainExtraction-TissueSegmentation-Macaque | b5329035d9e32c8a27151cf2396eaf209396a334 | [
"MIT"
] | 770 | 2021-09-08T01:38:04.000Z | 2022-03-31T10:00:33.000Z | nnformer/utilities/folder_names.py | cccyyy24/nnFormer | 04bd7d91489f52cba709c5e53d42baec906248ef | [
"MIT"
] | 56 | 2021-09-09T03:11:27.000Z | 2022-03-29T03:18:18.000Z | nnformer/utilities/folder_names.py | cccyyy24/nnFormer | 04bd7d91489f52cba709c5e53d42baec906248ef | [
"MIT"
] | 133 | 2021-09-08T03:06:41.000Z | 2022-03-02T15:04:30.000Z | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 37.75 | 114 | 0.689845 |
b91fde6edb6e56a92d76777b4baac8d4ff344f4c | 5,138 | py | Python | main/PublicEmotionDatasets/Adobe/process/label_adobe_v.py | cvlab-stonybrook/Emotion-Prediction | fb45f943208467ef91d8e43874599263f669166d | [
"MIT"
] | 10 | 2019-12-19T21:17:46.000Z | 2022-02-22T15:47:29.000Z | main/PublicEmotionDatasets/Adobe/process/label_adobe_v.py | cvlab-stonybrook/Emotion-Prediction | fb45f943208467ef91d8e43874599263f669166d | [
"MIT"
] | 2 | 2020-06-05T03:14:15.000Z | 2020-06-14T09:14:54.000Z | main/PublicEmotionDatasets/Adobe/process/label_adobe_v.py | cvlab-stonybrook/Emotion-Prediction | fb45f943208467ef91d8e43874599263f669166d | [
"MIT"
] | 2 | 2020-01-08T14:49:46.000Z | 2021-06-06T03:36:04.000Z | """
Copyright (c) 2019 Yevheniia Soroka
Licensed under the MIT License
Author: Yevheniia Soroka
Email: ysoroka@cs.stonybrook.edu
Last modified: 18/12/2019
Usage:
Run this script to label Adobe images using word embeddings:
label with 8 classes according to strategy 3 -- using only emotional tags,
image label is a vect... | 33.148387 | 103 | 0.604126 |
eab1bac3b988f49a228877e68eaed9f12b23ea6d | 3,978 | py | Python | myven/lib/python3.8/site-packages/ansible/module_utils/ansible_tower.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/module_utils/ansible_tower.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/module_utils/ansible_tower.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | 42.774194 | 94 | 0.708145 |
efa34b9e7b4ecb964c0b132443a4a64c2de166b0 | 1,011 | py | Python | codigos_python_funcoes/exemplo3-contagem de cupons com desconto.py | rosacarla/100-days-of-python-code | 3db9e35f861ce933e952cff2dd3a505dfce1b440 | [
"MIT"
] | 1 | 2021-09-26T09:17:36.000Z | 2021-09-26T09:17:36.000Z | codigos_python_funcoes/exemplo3-contagem de cupons com desconto.py | rosacarla/100-days-of-python-code | 3db9e35f861ce933e952cff2dd3a505dfce1b440 | [
"MIT"
] | null | null | null | codigos_python_funcoes/exemplo3-contagem de cupons com desconto.py | rosacarla/100-days-of-python-code | 3db9e35f861ce933e952cff2dd3a505dfce1b440 | [
"MIT"
] | null | null | null | # Um restaurante gostaria de limitar a quantidade de cupons de desconto utilizados por noite em seu estabelecimento.
# Para tal, o dono gostaria de um aplicativo em que a recepcionista do restaurante pudesse informar toda vez que um ou mais
# clientes apresentassem o cupom na entrada, e quando o limite da noite fosse a... | 34.862069 | 123 | 0.726014 |
aec96977edc2430022960a45cbb9cb4ed1de06ac | 7,996 | py | Python | test/test_filefilter.py | swt30/beets | 1d3637e507965a733fa3bdc78777394b7fd35cf4 | [
"MIT"
] | null | null | null | test/test_filefilter.py | swt30/beets | 1d3637e507965a733fa3bdc78777394b7fd35cf4 | [
"MIT"
] | null | null | null | test/test_filefilter.py | swt30/beets | 1d3637e507965a733fa3bdc78777394b7fd35cf4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Malte Ried.
#
# 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 r... | 39.004878 | 79 | 0.600425 |
55271bf405a48d19e79b36741e03cf0d90f722b7 | 2,475 | py | Python | python/validator/validate.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | 3 | 2020-02-18T20:54:13.000Z | 2022-01-14T17:11:45.000Z | python/validator/validate.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | 41 | 2020-03-19T19:00:51.000Z | 2022-03-05T02:12:18.000Z | python/validator/validate.py | agahchen/RSBC-DataHub-API | d3742a09851d5753809e8eb8e1f7f6ca10b121ad | [
"Apache-2.0"
] | 6 | 2020-02-20T20:05:24.000Z | 2022-01-25T02:19:29.000Z | import logging
from python.common.config import Config
from python.common.helper import load_json_into_dict
from cerberus import Validator as Cerberus
logging.basicConfig(level=Config.LOG_LEVEL, format=Config.LOG_FORMAT)
class Validate:
def __init__(self, config):
self.config = config
self.schem... | 43.421053 | 105 | 0.661818 |
f8dce9de5c347656ceaed85c14c32a41174541e6 | 884 | py | Python | ingredient_phrase_tagger/training/cli.py | MilanParikh/ingredient-phrase-tagger | 3490158755d9f8bfc6c1b8c819e0c0a523818a96 | [
"Apache-2.0"
] | 1 | 2021-11-04T00:21:25.000Z | 2021-11-04T00:21:25.000Z | ingredient_phrase_tagger/training/cli.py | MilanParikh/ingredient-phrase-tagger | 3490158755d9f8bfc6c1b8c819e0c0a523818a96 | [
"Apache-2.0"
] | null | null | null | ingredient_phrase_tagger/training/cli.py | MilanParikh/ingredient-phrase-tagger | 3490158755d9f8bfc6c1b8c819e0c0a523818a96 | [
"Apache-2.0"
] | 1 | 2021-11-04T00:23:26.000Z | 2021-11-04T00:23:26.000Z | import optparse
import labelled_data
import translator
class Cli(object):
def __init__(self, argv):
self.opts = self._parse_args(argv)
def run(self):
"""
Generates training data in the CRF++ format for the ingredient
tagging task
"""
with open(self.opts.data_... | 23.891892 | 70 | 0.576923 |
7105ee2cfde496ecc43ba9be2be796013a41afc5 | 1,019 | py | Python | Progressbar/delete.py | XtremeDevX/Rapid-Delete | 8b95d4e8983d85396059869480f246b91a53f8e8 | [
"MIT"
] | 149 | 2022-02-05T18:57:34.000Z | 2022-03-31T20:03:55.000Z | Progressbar/delete.py | XtremeDevX/turbodelete | 8b95d4e8983d85396059869480f246b91a53f8e8 | [
"MIT"
] | 3 | 2022-02-21T22:49:15.000Z | 2022-02-25T07:07:56.000Z | Progressbar/delete.py | XtremeDevX/turbodelete | 8b95d4e8983d85396059869480f246b91a53f8e8 | [
"MIT"
] | 2 | 2022-02-20T14:26:51.000Z | 2022-02-21T00:15:37.000Z | from subprocess import Popen, PIPE
from progress.bar import Bar
from pathlib import Path
import time
import sys
import os
os.system('color')
file_path = sys.argv[1]
def rmdir(directory, bar: Bar):
directory = Path(directory)
for item in directory.iterdir():
if item.is_dir():
rmdir(item, b)... | 27.540541 | 194 | 0.594701 |
f0a9ce2d4bbc93f46296271af881509f98eb82c2 | 193 | py | Python | reportes/forms.py | fernandosg/platformsales | 20a46288ceea576a5efff9e5a7d81d3c2280c289 | [
"MIT"
] | null | null | null | reportes/forms.py | fernandosg/platformsales | 20a46288ceea576a5efff9e5a7d81d3c2280c289 | [
"MIT"
] | null | null | null | reportes/forms.py | fernandosg/platformsales | 20a46288ceea576a5efff9e5a7d81d3c2280c289 | [
"MIT"
] | null | null | null | from django import forms
from reportes.models import MensajeOperacion
class CrearReporte(forms.ModelForm):
class Meta():
model=MensajeOperacion
fields=["mensaje","estado"]
| 24.125 | 44 | 0.73057 |
b30007061fba58219eddc7818cb49f39ed87a308 | 378 | py | Python | corehq/sql_proxy_accessors/migrations/0016_get_case_ids_in_domain_by_owners.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | corehq/sql_proxy_accessors/migrations/0016_get_case_ids_in_domain_by_owners.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | corehq/sql_proxy_accessors/migrations/0016_get_case_ids_in_domain_by_owners.py | dannyroberts/commcare-hq | 4b0b8ecbe851e46307d3a0e635d6d5d6e31c3598 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations
from corehq.sql_db.operations import noop_migration
class Migration(migrations.Migration):
dependencies = [
('sql_proxy_accessors', '0015_save_ledger_values_rebuild'),... | 19.894737 | 67 | 0.724868 |
ef0b41bc21003435d576361fd3f5578ecd7f30cc | 5,921 | py | Python | analizador_sintactico.py | narommm/Analisis-lexico-sintactico-Python | ad41ae0c6fea95f03b59be36a17d68f29803f2ce | [
"MIT"
] | null | null | null | analizador_sintactico.py | narommm/Analisis-lexico-sintactico-Python | ad41ae0c6fea95f03b59be36a17d68f29803f2ce | [
"MIT"
] | null | null | null | analizador_sintactico.py | narommm/Analisis-lexico-sintactico-Python | ad41ae0c6fea95f03b59be36a17d68f29803f2ce | [
"MIT"
] | null | null | null | import ply.yacc as yacc
from analizador_lexico import tokens
from analizador_lexico import analizador
# resultado del analisis
resultado_gramatica = []
precedence = (
('right','ASIGNAR'),
('left', 'SUMA', 'RESTA'),
('left', 'MULT', 'DIV'),
('right', 'UMINUS'),
('right', 'PUNTOCOMA'),
('left', ... | 28.882927 | 151 | 0.537071 |
88de7bc317f357851138e171a602c893515d41e9 | 9,361 | py | Python | blockfrost/api/cardano/pools.py | AstroWa3l/blockfrost-python | dd3661ee3b882cc2081292327adbbf2d61fda0f9 | [
"Apache-2.0"
] | 1 | 2021-12-13T22:28:45.000Z | 2021-12-13T22:28:45.000Z | blockfrost/api/cardano/pools.py | AstroWa3l/blockfrost-python | dd3661ee3b882cc2081292327adbbf2d61fda0f9 | [
"Apache-2.0"
] | null | null | null | blockfrost/api/cardano/pools.py | AstroWa3l/blockfrost-python | dd3661ee3b882cc2081292327adbbf2d61fda0f9 | [
"Apache-2.0"
] | null | null | null | import requests
from blockfrost.utils import request_wrapper, list_request_wrapper
@list_request_wrapper
def pools(self, **kwargs):
"""
List of registered stake pools.
https://docs.blockfrost.io/#tag/Cardano-Pools/paths/~1pools/get
:param gather_pages: Optional. Default: false. Will collect all page... | 32.616725 | 90 | 0.682085 |
3db470f9df4cab7607d926dd1eb40f9747bdb4ac | 13,214 | py | Python | tests/models/test_model_core.py | Officium/tensorlayer | 89bd7646cff2bc77c6569f2a51d48bc1e80229e4 | [
"Apache-2.0"
] | 1 | 2019-10-21T13:33:52.000Z | 2019-10-21T13:33:52.000Z | tests/models/test_model_core.py | Mesica/tensorlayer | c5def14c4d66d150863f975d9001a5e1891d003f | [
"Apache-2.0"
] | null | null | null | tests/models/test_model_core.py | Mesica/tensorlayer | c5def14c4d66d150863f975d9001a5e1891d003f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *
from tensorlayer.models import *
from tests.utils import CustomTestCase
def basic_static_model():
... | 30.946136 | 109 | 0.580975 |
71727855c3b5a49ba770b23fd1b96b453bcf8530 | 855 | py | Python | carPooling/migrations/0018_auto_20190521_1651.py | yangtao4389/pinche | 81463761058f67d47cea980f29a061b1e1b2d08a | [
"Apache-2.0"
] | 1 | 2020-09-30T01:27:57.000Z | 2020-09-30T01:27:57.000Z | carPooling/migrations/0018_auto_20190521_1651.py | yangtao4389/pinche | 81463761058f67d47cea980f29a061b1e1b2d08a | [
"Apache-2.0"
] | 9 | 2020-06-05T19:51:33.000Z | 2022-03-11T23:40:25.000Z | carPooling/migrations/0018_auto_20190521_1651.py | yangtao4389/pinche | 81463761058f67d47cea980f29a061b1e1b2d08a | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.4 on 2019-05-21 16:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('carPooling', '0017_carpoolingrecunbook'),
]
operations = [
migrations.AlterField(
model_name='carpoolinguserconf',
n... | 29.482759 | 98 | 0.611696 |
ab7e7548747eb05d4abd461c1f3aaf929d9b9cc9 | 570 | py | Python | app/utils/json_utils.py | LuoLuo0101/cognition-stock | 62201106fbb50635ca731921c159a700bc36ebb4 | [
"MIT"
] | null | null | null | app/utils/json_utils.py | LuoLuo0101/cognition-stock | 62201106fbb50635ca731921c159a700bc36ebb4 | [
"MIT"
] | null | null | null | app/utils/json_utils.py | LuoLuo0101/cognition-stock | 62201106fbb50635ca731921c159a700bc36ebb4 | [
"MIT"
] | null | null | null | import json
from datetime import datetime
from decimal import Decimal
class CustomJSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime):
return obj.isoformat()
if hasattr(obj, "to_dict"):
return obj.to_dict()
if isinstance(obj, Decimal)... | 24.782609 | 67 | 0.654386 |
29975a5e4aa3343d234a3f8766e19b29d3053086 | 1,541 | py | Python | projects/eyetracking/pipeline/monitor.py | nirdslab/streaminghub | a0d9f5f8be0ee6f090bd2b48b9f596695497c2bf | [
"MIT"
] | null | null | null | projects/eyetracking/pipeline/monitor.py | nirdslab/streaminghub | a0d9f5f8be0ee6f090bd2b48b9f596695497c2bf | [
"MIT"
] | null | null | null | projects/eyetracking/pipeline/monitor.py | nirdslab/streaminghub | a0d9f5f8be0ee6f090bd2b48b9f596695497c2bf | [
"MIT"
] | 1 | 2020-01-22T15:35:29.000Z | 2020-01-22T15:35:29.000Z | #!/usr/bin/env python3
import math
import numpy as np
class Monitor:
def __init__(self, w, h, screen, dist, n=5):
"""
Create Monitor Configuration
@param w: Screen Width (px)
@param h: Screen Height (px)
@param screen: Screen Size (in)
@param dist: Distance between Subject and Screen (in... | 24.460317 | 68 | 0.570409 |
104f867711a8f4f74d2873dae131c9f10f6500c6 | 1,483 | py | Python | point_class_basic.py | markfoleyie/pa1_2021 | b6011ff6eece29e53095a8cf69d0f2764e8d0c88 | [
"MIT"
] | 1 | 2020-10-01T20:22:40.000Z | 2020-10-01T20:22:40.000Z | point_class_basic.py | markfoleyie/pa1_2021 | b6011ff6eece29e53095a8cf69d0f2764e8d0c88 | [
"MIT"
] | null | null | null | point_class_basic.py | markfoleyie/pa1_2021 | b6011ff6eece29e53095a8cf69d0f2764e8d0c88 | [
"MIT"
] | 3 | 2020-10-29T21:19:37.000Z | 2021-02-25T20:04:30.000Z | """
This program creates a 'Point' class and tests it. A point is basically a pair of x,y coordinates in
cartesian space. It has methods to add two points and to compute sthe distance between two points.
Note that this is a really basic example, a more comprehensive example is in point-class.py.
MF, Nov 2018
"""
imp... | 29.078431 | 101 | 0.643291 |
1aa646db17b76bdaa12648b8665e2300873a76c5 | 6,992 | py | Python | frcnn_eval/voc_eval.py | deneb2016/WSDDN.pytorch | 8b7e8dd8c8b1f20af03863e571bef9e7dfc26565 | [
"MIT"
] | 17 | 2019-01-28T07:16:49.000Z | 2020-10-18T04:17:31.000Z | frcnn_eval/voc_eval.py | deneb2016/WSDDN.pytorch | 8b7e8dd8c8b1f20af03863e571bef9e7dfc26565 | [
"MIT"
] | 3 | 2019-02-26T09:52:40.000Z | 2020-07-30T02:27:22.000Z | frcnn_eval/voc_eval.py | deneb2016/WSDDN.pytorch | 8b7e8dd8c8b1f20af03863e571bef9e7dfc26565 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Bharath Hariharan
#
# Modified by Seungkwan Lee for WSDDN
# --------------------------------------------------------
import xml.etree.ElementTree as ET
import os
import pic... | 34.107317 | 88 | 0.52746 |
7c9a0e8ee920097153950150f7c418b496e22aa9 | 463 | py | Python | examples/helpers.py | cobwebsonsale/imgurpython | 48abc45a143ee9d2485c22a63b7cd55701d8163c | [
"MIT"
] | 560 | 2015-01-01T15:06:39.000Z | 2022-03-19T04:05:20.000Z | examples/helpers.py | cobwebsonsale/imgurpython | 48abc45a143ee9d2485c22a63b7cd55701d8163c | [
"MIT"
] | 58 | 2015-01-30T10:20:32.000Z | 2021-07-24T18:56:04.000Z | examples/helpers.py | cobwebsonsale/imgurpython | 48abc45a143ee9d2485c22a63b7cd55701d8163c | [
"MIT"
] | 168 | 2015-01-20T01:26:00.000Z | 2022-03-21T01:43:51.000Z | '''
These functions have nothing to do with the API, they just help ease
issues between Python 2 and 3
'''
def get_input(string):
''' Get input from console regardless of python 2 or 3 '''
try:
return raw_input(string)
except:
return input(string)
def get_config():
''' Create a config parser for reading INI... | 23.15 | 69 | 0.734341 |
9ec47506c56c13b6c6b1f755e02d1bbfc7eff35c | 8,004 | py | Python | kmip/tests/unit/core/messages/payloads/test_revoke.py | openstack/deb-python-pykmip | cbcb5b97bf913178fd7ed364feb06e9530efc4de | [
"Apache-2.0"
] | 10 | 2016-09-14T21:59:43.000Z | 2019-01-28T21:58:08.000Z | kmip/tests/unit/core/messages/payloads/test_revoke.py | openstack/deb-python-pykmip | cbcb5b97bf913178fd7ed364feb06e9530efc4de | [
"Apache-2.0"
] | null | null | null | kmip/tests/unit/core/messages/payloads/test_revoke.py | openstack/deb-python-pykmip | cbcb5b97bf913178fd7ed364feb06e9530efc4de | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Hewlett Packard Development Company, L.P.
# 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
#
# Unl... | 35.892377 | 79 | 0.645802 |
80d681a92bb1f2a14ae0bb53e4cc4cfa78b00a97 | 8,577 | py | Python | Proyecto Sinergia/regclientes.py | sabroso/Sinergia | 80fd8035493ed9737953789d701e85d8f9bbe909 | [
"MIT"
] | null | null | null | Proyecto Sinergia/regclientes.py | sabroso/Sinergia | 80fd8035493ed9737953789d701e85d8f9bbe909 | [
"MIT"
] | null | null | null | Proyecto Sinergia/regclientes.py | sabroso/Sinergia | 80fd8035493ed9737953789d701e85d8f9bbe909 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
#############################
import sys, os
from shutil import *
# import qdarkstyle
from funciones import *
###############
import hashlib
################
from PyQt5.QtWidgets import *
##############################
from PyQt5.QtGui import *
############################
from PyQt5.QtCore im... | 29.885017 | 62 | 0.623178 |
19deb27a38e9336f52684e36e1e45998f94c5471 | 1,143 | py | Python | farabio/models/segmentation/backbones/mobilenet.py | tuttelikz/farabi | 5b65cdf39ceecbd69ae759d030b132ee74661b48 | [
"Apache-2.0"
] | 53 | 2021-04-06T17:57:12.000Z | 2022-03-07T17:45:45.000Z | farabio/models/segmentation/backbones/mobilenet.py | tuttelikz/farabi | 5b65cdf39ceecbd69ae759d030b132ee74661b48 | [
"Apache-2.0"
] | 1 | 2022-03-07T19:48:44.000Z | 2022-03-07T19:49:47.000Z | farabio/models/segmentation/backbones/mobilenet.py | tuttelikz/farabi | 5b65cdf39ceecbd69ae759d030b132ee74661b48 | [
"Apache-2.0"
] | 2 | 2021-12-06T14:42:44.000Z | 2021-12-07T11:33:14.000Z | import torch.nn as nn
from farabio.models.classification import MobileNetV2
from farabio.models.segmentation.backbones import BackboneExtension
__all__ = ['MobileNetV2Backbone', 'mobilenet_backbones']
class MobileNetV2Backbone(MobileNetV2, BackboneExtension):
def __init__(self, out_channels, depth=5, **kwargs):
... | 25.977273 | 67 | 0.572178 |
b330801db14cfc3487eb3a06d633dbbb13ba28a3 | 344 | py | Python | Week 7: Sets and Dictionaries/7 (07).py | MLunov/Python-programming-basics-HSE | 7df8bba105db84d6b932c454fdc39193a648254e | [
"MIT"
] | null | null | null | Week 7: Sets and Dictionaries/7 (07).py | MLunov/Python-programming-basics-HSE | 7df8bba105db84d6b932c454fdc39193a648254e | [
"MIT"
] | null | null | null | Week 7: Sets and Dictionaries/7 (07).py | MLunov/Python-programming-basics-HSE | 7df8bba105db84d6b932c454fdc39193a648254e | [
"MIT"
] | null | null | null | # второй раз за курс скатал, но модифицировал с:
n = int(input())
all_nums = set(range(1, n + 1))
while True:
guess = input()
if guess == 'HELP':
break
guess = {int(x) for x in guess.split()}
answer = input()
if answer == 'YES':
all_nums &= guess
else:
all_nums -= guess
p... | 22.933333 | 48 | 0.569767 |
1c7819ce10176e4253878dc1c83c864f95b72704 | 404 | py | Python | Python/LearnPythonTheHardWay/ex7.py | bryarcole/The-Portfolio | 62c2573ce4f007dccf5be1d67daf97286d6b4a5e | [
"MIT"
] | null | null | null | Python/LearnPythonTheHardWay/ex7.py | bryarcole/The-Portfolio | 62c2573ce4f007dccf5be1d67daf97286d6b4a5e | [
"MIT"
] | null | null | null | Python/LearnPythonTheHardWay/ex7.py | bryarcole/The-Portfolio | 62c2573ce4f007dccf5be1d67daf97286d6b4a5e | [
"MIT"
] | null | null | null | print "Marry had a little lamb."
print "Its fleece was white as %s." %'snow'
print "And everywhere that Mary went."
print "." * 10 #hmm.. interesting..
end1 = "C"
end2 = "h"
end3 = "e"
end4 = "e"
end5 = "s"
end6 = "e"
end7 = "B"
end8 = "u"
end9 = "r"
end10 = "g"
end11 = "e"
end12 = "r"
#print out results
print end1 +... | 17.565217 | 48 | 0.601485 |
05fd9a809a25141684eaa49bd67063e125cbb915 | 489 | py | Python | mnist.py | GRSEB9S/deepSVMnet | 03f4818e62d8d86fff0bd8e8a2863beb4bf11267 | [
"MIT"
] | 1 | 2022-03-08T07:37:31.000Z | 2022-03-08T07:37:31.000Z | mnist.py | GRSEB9S/deepSVMnet | 03f4818e62d8d86fff0bd8e8a2863beb4bf11267 | [
"MIT"
] | null | null | null | mnist.py | GRSEB9S/deepSVMnet | 03f4818e62d8d86fff0bd8e8a2863beb4bf11267 | [
"MIT"
] | null | null | null | # Bupe Chomba Derreck (BCD)
# December 2017
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
def get_mnist():
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
x_train = np.array([img.reshape(1,28,28) for img in mnist.train.images])
y_train = mnist... | 25.736842 | 76 | 0.697342 |
24f1b4181cdf1e460d24005154fd53fbbbf5bcfb | 570 | py | Python | utils/compute_speed.py | VakhrameevaLiza/pytorch_segmentation_framework | 7df02ba5c575ed0ed082090f80eca4b421f0c98e | [
"MIT"
] | null | null | null | utils/compute_speed.py | VakhrameevaLiza/pytorch_segmentation_framework | 7df02ba5c575ed0ed082090f80eca4b421f0c98e | [
"MIT"
] | null | null | null | utils/compute_speed.py | VakhrameevaLiza/pytorch_segmentation_framework | 7df02ba5c575ed0ed082090f80eca4b421f0c98e | [
"MIT"
] | null | null | null | import time
import torch
def compute_speed(model, input_size, iteration=500):
torch.backends.cudnn.benchmark = True
model.train()
model = model.cuda()
input = torch.randn(*input_size).cuda()
for _ in range(10):
model(input)
torch.cuda.synchronize()
torch.cuda.synchronize()
... | 19 | 52 | 0.659649 |
ad0a8f6d3a4fb438d64a5a618396c19bab3f96bd | 11,934 | py | Python | applications/ConvectionDiffusionApplication/python_scripts/adjoint_diffusion_solver.py | AdriaMP/Kratos | d05decd40d46a7e59b63b109fe8e46940df715e7 | [
"BSD-4-Clause"
] | null | null | null | applications/ConvectionDiffusionApplication/python_scripts/adjoint_diffusion_solver.py | AdriaMP/Kratos | d05decd40d46a7e59b63b109fe8e46940df715e7 | [
"BSD-4-Clause"
] | null | null | null | applications/ConvectionDiffusionApplication/python_scripts/adjoint_diffusion_solver.py | AdriaMP/Kratos | d05decd40d46a7e59b63b109fe8e46940df715e7 | [
"BSD-4-Clause"
] | null | null | null | import KratosMultiphysics as kratos
import KratosMultiphysics.ConvectionDiffusionApplication as convdiff
from KratosMultiphysics.python_solver import PythonSolver
def CreateSolver(model, settings):
return AdjointDiffusionSolver(model, settings)
class AdjointDiffusionSolver(PythonSolver):
def __init__(self, ... | 46.8 | 177 | 0.660969 |
f38fff8af772102b9fdd89dc435573268164ea80 | 9,740 | py | Python | phathom/multivol/multi_volume_visual.py | chunglabmit/phathom | 304db7a95e898e9b03d6b2640172752d21a7e3ed | [
"MIT"
] | 1 | 2018-04-18T11:54:29.000Z | 2018-04-18T11:54:29.000Z | phathom/multivol/multi_volume_visual.py | chunglabmit/phathom | 304db7a95e898e9b03d6b2640172752d21a7e3ed | [
"MIT"
] | 2 | 2018-04-05T20:53:52.000Z | 2018-11-01T16:37:39.000Z | phathom/multivol/multi_volume_visual.py | chunglabmit/phathom | 304db7a95e898e9b03d6b2640172752d21a7e3ed | [
"MIT"
] | null | null | null | # This file implements a MultiVolumeVisual class that can be used to show
# multiple volumes simultaneously. It is derived from the original VolumeVisual
# class in vispy.visuals.volume, which is releaed under a BSD license included
# here:
#
# ===========================================================================... | 37.461538 | 134 | 0.624949 |
c923da8036c14542ca943dd156b2c613779e4677 | 1,304 | py | Python | LeetCode/python/001-030/015-3sum/solution.py | shootsoft/practice | 49f28c2e0240de61d00e4e0291b3c5edd930e345 | [
"Apache-2.0"
] | null | null | null | LeetCode/python/001-030/015-3sum/solution.py | shootsoft/practice | 49f28c2e0240de61d00e4e0291b3c5edd930e345 | [
"Apache-2.0"
] | null | null | null | LeetCode/python/001-030/015-3sum/solution.py | shootsoft/practice | 49f28c2e0240de61d00e4e0291b3c5edd930e345 | [
"Apache-2.0"
] | null | null | null | class Solution:
# @return a list of lists of length 3, [[val1,val2,val3]]
def threeSum(self, num):
self.result = []
num.sort()
length = len(num)
#print num
for i in range(0, length-2):
#print i
if i>0 and num[i-1] == num[i]:
#print... | 27.166667 | 65 | 0.429448 |
7bc5e74600c0a4c17f242049522f29aea46b277c | 8,006 | py | Python | sinling/sinhala/tokenizer.py | ysenarath/sinling | 34b4e3cecc8026f21d2845653ddb935c7705fea4 | [
"Apache-2.0"
] | 31 | 2019-06-19T09:26:28.000Z | 2022-01-04T02:08:59.000Z | sinling/sinhala/tokenizer.py | ysenarath/sinling | 34b4e3cecc8026f21d2845653ddb935c7705fea4 | [
"Apache-2.0"
] | 6 | 2020-04-18T07:15:53.000Z | 2021-02-09T01:41:22.000Z | sinling/sinhala/tokenizer.py | ysenarath/sinling | 34b4e3cecc8026f21d2845653ddb935c7705fea4 | [
"Apache-2.0"
] | 13 | 2019-11-06T03:10:05.000Z | 2021-12-06T02:19:51.000Z | import re
from typing import Tuple, Text, Dict, List
import emoji
from sinling.core import Tokenizer
Boolean = bool
__all__ = [
'SinhalaTokenizer',
'SinhalaTweetTokenizer'
]
def is_a_sinhala_letter(s: Text) -> Boolean:
if len(s) != 1:
return True
sinhala_lower_bound = 3456
sinhala_uppe... | 40.434343 | 120 | 0.503872 |
26618ebbe0614a5843822aee9aaec1d69ef15ada | 10,217 | py | Python | fid_score.py | OnizukaLab/pytorch-fid | 08f3028f5cf543cbbc6f068e627758dbf8decbc8 | [
"Apache-2.0"
] | null | null | null | fid_score.py | OnizukaLab/pytorch-fid | 08f3028f5cf543cbbc6f068e627758dbf8decbc8 | [
"Apache-2.0"
] | null | null | null | fid_score.py | OnizukaLab/pytorch-fid | 08f3028f5cf543cbbc6f068e627758dbf8decbc8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Calculates the Frechet Inception Distance (FID) to evalulate GANs
The FID metric calculates the distance between two distributions of images.
Typically, we have summary statistics (mean & covariance matrix) of one
of these distributions, while the 2nd distribution is given by a GAN.
When run... | 37.701107 | 88 | 0.628952 |
061e0dc6cea7ed31ee02e3c665486bdc91ef8066 | 4,540 | py | Python | war3observer/game.py | pedrus16/war3observer | 4fa0c94109360f559a88111eaf18c2f72207d6ba | [
"MIT"
] | null | null | null | war3observer/game.py | pedrus16/war3observer | 4fa0c94109360f559a88111eaf18c2f72207d6ba | [
"MIT"
] | null | null | null | war3observer/game.py | pedrus16/war3observer | 4fa0c94109360f559a88111eaf18c2f72207d6ba | [
"MIT"
] | null | null | null | import asyncio
import mmap
import struct
from war3structs.observer import ObserverGame, ObserverPlayer
class SharedMemoryFile():
"""SharedMemoryFile class
This opens a memory mapped file at the specified offset with the
specified size, but takes care of having the offset conform to the
ALLOCATIONGRANULARITY ... | 28.375 | 102 | 0.69163 |
24c3f2c364c7eac24cec1551b8d5e3f086e53793 | 23,063 | py | Python | main.py | mmendiet/DeepRL_pytorch | 626e6c5290335ef320ca2d83f01c674f3a3ca8fc | [
"Apache-2.0"
] | null | null | null | main.py | mmendiet/DeepRL_pytorch | 626e6c5290335ef320ca2d83f01c674f3a3ca8fc | [
"Apache-2.0"
] | null | null | null | main.py | mmendiet/DeepRL_pytorch | 626e6c5290335ef320ca2d83f01c674f3a3ca8fc | [
"Apache-2.0"
] | null | null | null | #######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... | 45.044922 | 122 | 0.708017 |
b8af8aa1d556e11e7978747322544d3898b19e2c | 13,639 | py | Python | tests/test_router.py | LuaFan2/BlackSheep | dceee596b01e883120c819be2e65efd6ded3bb3a | [
"MIT"
] | null | null | null | tests/test_router.py | LuaFan2/BlackSheep | dceee596b01e883120c819be2e65efd6ded3bb3a | [
"MIT"
] | null | null | null | tests/test_router.py | LuaFan2/BlackSheep | dceee596b01e883120c819be2e65efd6ded3bb3a | [
"MIT"
] | null | null | null | import pytest
from blacksheep import HttpMethod
from blacksheep.server.routing import Router, Route, RouteDuplicate
FAKE = b"FAKE"
MATCHING_ROUTES = [
("head", b"", b"/"),
("get", b"", b"/"),
("head", b"/", b"/"),
("get", b"/", b"/"),
("get", b"/:a", b"/foo"),
("get", b"/foo", b"/foo"),
(... | 22.213355 | 84 | 0.602024 |
9835f1d3c372f0ea663dc6c41e656eeb4e96f3d1 | 1,694 | py | Python | source code/counting unique items.py | starkworld/Python-Course-work | 28715f079939129b442aedcd7edb2e0838886ba0 | [
"Apache-2.0"
] | null | null | null | source code/counting unique items.py | starkworld/Python-Course-work | 28715f079939129b442aedcd7edb2e0838886ba0 | [
"Apache-2.0"
] | null | null | null | source code/counting unique items.py | starkworld/Python-Course-work | 28715f079939129b442aedcd7edb2e0838886ba0 | [
"Apache-2.0"
] | null | null | null | """
Author : nkalyan🤠
implementing Python Scripts on reading and returning the name and max no of mails that sent by a person
"""
from collections import defaultdict
def get_line(fp):
"""This method yields the each mail at a time and gives input to mail_counter method"""
with fp:
for line in fp:
... | 27.322581 | 105 | 0.608028 |
cfe6dc7142f7de1d61909b412e2f8aa29c81bf6a | 1,882 | py | Python | bom/migrations/0025_auto_20191221_1907.py | FixturFab/django-bomf | e6d7fec98197632cfa90f43c87b1bef60e09e874 | [
"MIT"
] | null | null | null | bom/migrations/0025_auto_20191221_1907.py | FixturFab/django-bomf | e6d7fec98197632cfa90f43c87b1bef60e09e874 | [
"MIT"
] | 7 | 2021-02-02T22:50:43.000Z | 2022-02-10T15:49:29.000Z | bom/migrations/0025_auto_20191221_1907.py | FixturFab/django-bomf | e6d7fec98197632cfa90f43c87b1bef60e09e874 | [
"MIT"
] | 1 | 2020-07-18T20:10:39.000Z | 2020-07-18T20:10:39.000Z | # Generated by Django 2.2.9 on 2019-12-21 19:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bom', '0024_auto_20191214_1342'),
]
operations = [
migrations.AlterField(
model_name='partrevision',
name='height_un... | 48.25641 | 257 | 0.498406 |
51b2112be0176a532a69e0ef29a0ce5b8807b319 | 758 | py | Python | skrobot/planner/__init__.py | HiroIshida/scikit-robot | 92835e7f809620287b4d8038a9aff79c03f1a26c | [
"MIT"
] | null | null | null | skrobot/planner/__init__.py | HiroIshida/scikit-robot | 92835e7f809620287b4d8038a9aff79c03f1a26c | [
"MIT"
] | null | null | null | skrobot/planner/__init__.py | HiroIshida/scikit-robot | 92835e7f809620287b4d8038a9aff79c03f1a26c | [
"MIT"
] | null | null | null | # flake8: noqa
from skrobot.planner.collision_checker import SweptSphereSdfCollisionChecker
from skrobot.planner.tinyfk_collision_checker import TinyfkSweptSphereSdfCollisionChecker
from skrobot.planner.tinyfk_sqp_based import tinyfk_sqp_plan_trajectory
from skrobot.planner.tinyfk_sqp_based import tinyfk_sqp_inverse_... | 50.533333 | 89 | 0.91029 |
ab167da9ec0b71fc4670fbaac17b5c3f657850e3 | 4,017 | py | Python | data/w8a.py | HarliWu/From-Deterioration-to-Acceleration-A-Calibration-Approach-to-Rehabilitating-Step-Asynchronism-in-Fe | 3a2f7196a2ca0446ce7ff7c8d15a0fa56a1d91d4 | [
"MIT"
] | null | null | null | data/w8a.py | HarliWu/From-Deterioration-to-Acceleration-A-Calibration-Approach-to-Rehabilitating-Step-Asynchronism-in-Fe | 3a2f7196a2ca0446ce7ff7c8d15a0fa56a1d91d4 | [
"MIT"
] | null | null | null | data/w8a.py | HarliWu/From-Deterioration-to-Acceleration-A-Calibration-Approach-to-Rehabilitating-Step-Asynchronism-in-Fe | 3a2f7196a2ca0446ce7ff7c8d15a0fa56a1d91d4 | [
"MIT"
] | null | null | null | import os
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision.datasets.utils import download_url
import torchvision.transforms as transforms
from .utils import _get_partitioner, _use_partitioner
class w8a(Dataset):
# CAUTION: SET THE LINK BELOW TO EMPTY WHEN MADE PUB... | 42.284211 | 137 | 0.648245 |
383e2ae6707083c9a2dce128b85afe47a0140208 | 800 | py | Python | terrabot/packets/__init__.py | JuanPotato/terrabot | fc503d0cf0a6bae2c70240dc4012b9d864c9006a | [
"MIT"
] | 1 | 2021-01-22T14:36:17.000Z | 2021-01-22T14:36:17.000Z | terrabot/packets/__init__.py | lvm/terrabot | 1875c23180b4bd4a40db2f970130e030198d775b | [
"MIT"
] | null | null | null | terrabot/packets/__init__.py | lvm/terrabot | 1875c23180b4bd4a40db2f970130e030198d775b | [
"MIT"
] | 2 | 2020-06-11T13:18:20.000Z | 2021-11-19T19:59:44.000Z | from .packet001 import *
from .packet002 import *
from .packet003 import *
from .packet004 import *
from .packet005 import *
from .packet006 import *
from .packet007 import *
from .packet008 import *
from .packet009 import *
from .packet010 import *
from .packet011 import *
from .packet012 import *
from .packet013 impo... | 24.242424 | 24 | 0.76 |
393bfa543e661f3ea8adc3ce67ec218766c6bb0e | 3,416 | py | Python | plantit/plantit/agents/models.py | Computational-Plant-Science/plan | 88ffeda7830291631c719398a60e07ced0433a5f | [
"BSD-3-Clause"
] | null | null | null | plantit/plantit/agents/models.py | Computational-Plant-Science/plan | 88ffeda7830291631c719398a60e07ced0433a5f | [
"BSD-3-Clause"
] | null | null | null | plantit/plantit/agents/models.py | Computational-Plant-Science/plan | 88ffeda7830291631c719398a60e07ced0433a5f | [
"BSD-3-Clause"
] | null | null | null | from enum import Enum
from datetime import timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import gettext_lazy
from django_celery_beat.models import PeriodicTask
class AgentExecutor(models.TextChoices):
LOCAL = 'loc... | 43.794872 | 118 | 0.752342 |
b036dbac56ca27f5459afe59b4bc27096cb938ae | 1,013 | py | Python | todo/menu_3.0.py | JRobayo99/Proyecto-RestauranteEAN | 3a7f71dbf5c09c1beafb4027ab3d7e9a4934ab30 | [
"MIT"
] | null | null | null | todo/menu_3.0.py | JRobayo99/Proyecto-RestauranteEAN | 3a7f71dbf5c09c1beafb4027ab3d7e9a4934ab30 | [
"MIT"
] | null | null | null | todo/menu_3.0.py | JRobayo99/Proyecto-RestauranteEAN | 3a7f71dbf5c09c1beafb4027ab3d7e9a4934ab30 | [
"MIT"
] | null | null | null | menu_restaurante=int(input("menu:\n 1- bandeja paisa $8.000 \n 2- hamburguesa de res $12.000 \n 3- pepitoria $7.500 \n 4- mojarra frita $5.500 \n 5- lasagna $14.000 \n 6- jugos naturales $3.500 \n 7- casuela de mariscoz $10.500 \n 0-salir \n"))
while menu_restaurante != 0:
if menu_restaurante == 1:
print("bandeja... | 48.238095 | 244 | 0.680158 |
c160cb86261c8a90c23bebcdbb15a0b0c97172db | 267 | py | Python | site/app/cookies.py | ddmendes/SEL0630 | 140d1e3ca61319a698d4062fe67f068ab1149360 | [
"MIT"
] | 1 | 2018-03-29T17:13:04.000Z | 2018-03-29T17:13:04.000Z | site/app/cookies.py | ddmendes/SEL0630 | 140d1e3ca61319a698d4062fe67f068ab1149360 | [
"MIT"
] | 11 | 2015-08-18T17:56:27.000Z | 2015-11-30T00:11:05.000Z | site/app/cookies.py | ddmendes/SEL0630 | 140d1e3ca61319a698d4062fe67f068ab1149360 | [
"MIT"
] | null | null | null | from flask import session
def getFromSession(key, defaultValue=None):
if key in session:
return session[key]
else:
session[key] = defaultValue
return defaultValue
def setToSession(key, value):
session[key] = value
| 19.071429 | 44 | 0.636704 |
7e87b0e12ea87f34629583b985ef028e2b19c754 | 1,744 | py | Python | pyVenv/src/InventoryManagement/InvManage/migrations/0011_auto_20200404_1918.py | thephilosophicaljijutsumaster/InventoryManagement | 7c57fcc435976c39b249106642ee848da2eea201 | [
"MIT"
] | null | null | null | pyVenv/src/InventoryManagement/InvManage/migrations/0011_auto_20200404_1918.py | thephilosophicaljijutsumaster/InventoryManagement | 7c57fcc435976c39b249106642ee848da2eea201 | [
"MIT"
] | 12 | 2020-07-05T14:30:46.000Z | 2020-08-06T21:06:00.000Z | pyVenv/src/InventoryManagement/InvManage/migrations/0011_auto_20200404_1918.py | thephilosophicaljijutsumaster/InventoryManagement | 7c57fcc435976c39b249106642ee848da2eea201 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.12 on 2020-04-04 13:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('InvManage', '0010_auto_20200325_1958'),
]
operations = [
migrations.CreateModel(
name='Purchas... | 36.333333 | 114 | 0.548165 |
50a246227510edfd4af3497b6c574dc4759a879e | 1,788 | py | Python | cloudconnectlib/common/log.py | isabella232/addonfactory-cloudconnect-library | ba01a5492e0d6f185954f6906b4f506325838fa4 | [
"Apache-2.0"
] | null | null | null | cloudconnectlib/common/log.py | isabella232/addonfactory-cloudconnect-library | ba01a5492e0d6f185954f6906b4f506325838fa4 | [
"Apache-2.0"
] | null | null | null | cloudconnectlib/common/log.py | isabella232/addonfactory-cloudconnect-library | ba01a5492e0d6f185954f6906b4f506325838fa4 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2021 Splunk 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... | 30.827586 | 74 | 0.748322 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.