repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
poliastro/poliastro | contrib/cr3bp_DhruvJ/example_L4_vertical_orb_fam_palc.py | 1 | 2671 | """
@author: Dhruv Jain, Multi-Body Dynamics Research Group, Purdue University
dhruvj9922@gmail.com
Obj: To compute family of L2 Vertical Orbit
Single Shooter Variabl Time Setup
1. Continue in 'x' + XZ plane symmetry and X-axis symmetry use => targets Period/4 states
2. PALC+ XZ plane symmetry and ... | mit | 9272f87aed140d3abaf9c7fe1e004b0a | 26.255102 | 149 | 0.670535 | 2.700708 | false | false | false | false |
poliastro/poliastro | src/poliastro/core/earth_atmosphere/jacchia.py | 1 | 6526 | """Low-level calculations for the Jacchia77 atmospheric model.
Given an exospheric temperature, Jacchia77 returns model
atmospheric altitude profiles of temperature, the number
densities of N2, O2, O, Ar, He, H, the sum thereof, and the
molecular weight.
For altitudes of 90 km and above, we use the 1977 model of
Jacc... | mit | 7317bd65b901925f773506f7c501e4a4 | 28.396396 | 79 | 0.426755 | 2.523589 | false | false | false | false |
poliastro/poliastro | contrib/cr3bp_DhruvJ/example.py | 1 | 1793 | """
Created on Tue Feb 8 22:13:15 2022
@author: Dhruv Jain, Multi-Body Dynamics Research Group, Purdue University
dhruvj9922@gmail.com
This is an exmaple file to test the CR3BP functions
"""
import matplotlib.pyplot as plt
from cr3bp_char_quant import sys_chars
from cr3bp_lib_calc import lib_pt_loc
from cr3... | mit | 972bd6f5f3e69a0fb085945e416d36a1 | 27.460317 | 92 | 0.655326 | 2.525352 | false | false | false | false |
poliastro/poliastro | src/poliastro/core/czml_utils.py | 1 | 2708 | import numpy as np
from numba import njit as jit
from poliastro._math.linalg import norm
@jit
def intersection_ellipsoid_line(x, y, z, u1, u2, u3, a, b, c):
"""Intersection of an ellipsoid defined by its axes a, b, c with the
line p + λu.
Parameters
----------
x, y, z : float
A point of ... | mit | 5297822c2a5f33be54a21bd9da3cdc50 | 25.80198 | 73 | 0.349095 | 2.840504 | false | false | false | false |
poliastro/poliastro | src/poliastro/frames/equatorial.py | 1 | 4174 | import numpy as np
from astropy import units as u
from astropy.coordinates import (
GCRS as _GCRS,
HCRS as _HCRS,
ICRS as _ICRS,
AffineTransform,
BaseRADecFrame,
CartesianDifferential,
FunctionTransformWithFiniteDifference,
TimeAttribute,
UnitSphericalRepresentation,
frame_transf... | mit | 038425276643203365b571cb2d72d17a | 25.0875 | 85 | 0.622185 | 3.333866 | false | false | false | false |
poliastro/poliastro | src/poliastro/spacecraft/__init__.py | 1 | 1540 | from astropy import units as u
class Spacecraft:
"""
Class to represent a Spacecraft.
"""
@u.quantity_input(A=u.km**2, C_D=u.one, m=u.kg)
def __init__(self, A, C_D, m, **metadata):
"""
Constructor
Parameters
----------
A : ~astropy.units.Quantity
... | mit | 5cdeae95f9d4e627a2bc5d0b85ec87af | 21.647059 | 80 | 0.521429 | 3.948718 | false | false | false | false |
poliastro/poliastro | src/poliastro/plotting/gabbard.py | 1 | 2478 | from astropy import units as u
from matplotlib import pyplot as plt
from poliastro.plotting.util import generate_label
class GabbardPlotter:
"""GabbardPlotter class."""
def __init__(
self, ax=None, dark=False, altitude_unit=u.km, period_unit=u.min
):
self._ax = ax
if not self._a... | mit | 8d2ecaea7d4b50901d00c6060deb48bc | 31.181818 | 74 | 0.573043 | 3.330645 | false | false | false | false |
poliastro/poliastro | src/poliastro/twobody/elements.py | 1 | 5997 | import numpy as np
from astropy import units as u
from poliastro.core.elements import (
circular_velocity as circular_velocity_fast,
coe2rv as coe2rv_fast,
coe2rv_many as coe2rv_many_fast,
eccentricity_vector as eccentricity_vector_fast,
)
from poliastro.core.propagation.farnocchia import (
delta_t... | mit | ea4a3f4e7bce5a6015b4d48d53166878 | 25.187773 | 80 | 0.538102 | 2.759779 | false | false | false | false |
poliastro/poliastro | src/poliastro/twobody/propagation/farnocchia.py | 1 | 1928 | import sys
import numpy as np
from astropy import units as u
from poliastro.core.propagation.farnocchia import (
farnocchia_coe as farnocchia_coe_fast,
farnocchia_rv as farnocchia_rv_fast,
)
from poliastro.twobody.propagation.enums import PropagatorKind
from poliastro.twobody.states import ClassicalState
fro... | mit | dee71089d65246c81b061a970b062621 | 28.661538 | 100 | 0.60529 | 3.150327 | false | false | false | false |
poliastro/poliastro | src/poliastro/earth/atmosphere/coesa62.py | 1 | 12174 | """ The U.S. Standard Atmosphere 1966 depicts idealized middle-latitude
year-round mean conditions for the range of solar activity that occurs between
sunspot minimum and sunspot maximum.
+--------+---------+---------+-----------+---------------+---------------+
| Z (km) | H (km) | T (K) | p (mbar) | rho (kg / m3)... | mit | b345e8a2535b98d3b3fa6c10671ec08a | 35.779456 | 87 | 0.440775 | 3.308152 | false | false | false | false |
poliastro/poliastro | src/poliastro/plotting/_base.py | 1 | 16905 | import warnings
from collections import namedtuple
from typing import List
import numpy as np
from astropy import units as u
from astropy.coordinates import CartesianRepresentation
from poliastro.ephem import Ephem
from poliastro.frames import Planes
from poliastro.plotting.util import BODY_COLORS, generate_label
fro... | mit | 20b73ab57fc86ecbc64ebe02965f5d53 | 31.385057 | 97 | 0.575747 | 4.123171 | false | false | false | false |
poliastro/poliastro | src/poliastro/core/thrust/change_a_inc.py | 1 | 3037 | import numpy as np
from numba import njit as jit
from numpy import cross
from poliastro._math.linalg import norm
from poliastro.core.elements import circular_velocity
@jit
def extra_quantities(k, a_0, a_f, inc_0, inc_f, f):
"""Extra quantities given by the Edelbaum (a, i) model."""
V_0, V_f, beta_0_ = comput... | mit | 9b3844924915d0e4d6e3d8477726026e | 26.563636 | 106 | 0.565633 | 2.659649 | false | false | false | false |
poliastro/poliastro | src/poliastro/earth/plotting/groundtrack.py | 1 | 7681 | """ Holds ground-track plotter for Earth satellites """
import plotly.graph_objects as go
from astropy import units as u
from astropy.coordinates import (
GCRS,
ITRS,
CartesianDifferential,
CartesianRepresentation,
SphericalRepresentation,
)
from poliastro.bodies import Earth
from poliastro.earth.... | mit | e35629aba0f09ca6355d80f47bfc5f18 | 28.316794 | 78 | 0.577659 | 4.163144 | false | false | false | false |
python-ivi/python-ivi | ivi/tektronix/tektronixOA5000.py | 2 | 8909 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2017 Alex Forencich
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... | mit | d9054af31ea555c8f290e5bbe4f07093 | 36.910638 | 99 | 0.584465 | 4.347975 | false | false | false | false |
python-ivi/python-ivi | ivi/tektronix/tektronixAWG2000.py | 2 | 23133 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2017 Alex Forencich
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... | mit | 49bda99d1ef31048a55b6bfcfc464b05 | 39.655536 | 104 | 0.601176 | 3.743204 | false | false | false | false |
python-ivi/python-ivi | setup.py | 7 | 2700 |
from __future__ import with_statement
# http://docs.python.org/distutils/
# http://packages.python.org/distribute/
try:
from setuptools import setup
except:
from distutils.core import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
... | mit | 19c5b34efb1ea32053df516af2230559 | 31.926829 | 82 | 0.589259 | 3.851641 | false | true | false | false |
python-ivi/python-ivi | ivi/agilent/agilent603xA.py | 2 | 13995 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2017 Alex Forencich
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... | mit | 8d3f45e93da8264e0ffa0f13c833d087 | 40.161765 | 107 | 0.60393 | 3.909218 | false | false | false | false |
python-ivi/python-ivi | ivi/agilent/agilentBaseInfiniiVision.py | 2 | 2400 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2017 Alex Forencich
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... | mit | 6c54698f4dc560b6108c5f5826df8fd7 | 41.857143 | 93 | 0.703333 | 3.675345 | false | false | false | false |
chapmanb/cloudbiolinux | cloudbio/deploy/vmlauncher/__init__.py | 1 | 17511 | from __future__ import print_function
import os
import time
from libcloud.compute.ssh import SSHClient
from libcloud.compute.base import NodeImage, NodeSize
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
import six
# Ubuntu 10.04 LTS (Lucid Lynx) Daily Build [20120302]
D... | mit | 4b65977b7e75f022b9fc8c20b7b1f0be | 34.51927 | 148 | 0.574153 | 3.745668 | false | false | false | false |
chapmanb/cloudbiolinux | cloudbio/custom/phylogeny.py | 10 | 2360 | """Install instructions for non-packaged phyologeny programs.
"""
import os
from fabric.api import *
from fabric.contrib.files import *
from cloudbio.custom.shared import _if_not_installed, _make_tmp_dir
def install_tracer(env):
"""A program for analysing results from Bayesian MCMC programs such as BEAST & MrBay... | mit | edf2472bb774b9f808eb864dc33e0866 | 46.2 | 114 | 0.577542 | 3.101183 | false | false | false | false |
chapmanb/cloudbiolinux | cloudbio/deploy/vmlauncher/transfer.py | 1 | 11794 | from __future__ import print_function
import os
import gzip
from operator import itemgetter
from sys import exit
from threading import Thread
from threading import Condition
from Queue import Queue
from fabric.api import local, put, sudo, cd
from fabric.colors import red
class FileSplitter:
"""
Works like ... | mit | 01e3d9ce7575ab59ed3a36d35d517e50 | 36.44127 | 116 | 0.58216 | 4.309098 | false | false | false | false |
chapmanb/cloudbiolinux | cloudbio/galaxy/applications.py | 10 | 19563 | """
This file is largely derived from a similar file in mi-deployment written Dr.
Enis Afgan.
https://bitbucket.org/afgane/mi-deployment/src/8cba95baf98f/tools_fabfile.py
Long term it will be best to install these packages for Galaxy via the Tool
Shed, however many of these tools are not yet in the tool shed and the ... | mit | edccad2c302ca1f3f7b25a995a2c502c | 44.389791 | 195 | 0.61785 | 2.882422 | false | false | false | false |
chapmanb/cloudbiolinux | cloudbio/utils.py | 10 | 7086 | """Utilities for logging and progress tracking.
"""
import logging
import os
import sys
from fabric.main import load_settings
from fabric.colors import yellow, red, green, magenta
from fabric.api import settings, hide, cd, run
from fabric.contrib.files import exists
from cloudbio.distribution import _setup_distributi... | mit | ecc80c9fc01f7ae339abbbfdba509793 | 40.438596 | 124 | 0.620519 | 3.880613 | false | true | false | false |
chapmanb/cloudbiolinux | cloudbio/custom/python.py | 10 | 1897 | """Install instructions for python libraries not ready for easy_install.
"""
import os
from fabric.api import *
from fabric.contrib.files import *
from shared import (_if_not_python_lib, _get_install, _python_make, _pip_cmd,
_is_anaconda)
@_if_not_python_lib("bx")
def install_bx_python(env):
... | mit | 92e1e036babe728721a70507eb3c6252 | 37.714286 | 88 | 0.635213 | 3.172241 | false | false | false | false |
chapmanb/cloudbiolinux | cloudbio/package/brew.py | 1 | 18385 | """Install packages via the MacOSX Homebrew and Linux Linuxbrew package manager.
https://github.com/mxcl/homebrew
https://github.com/Homebrew/linuxbrew
"""
from __future__ import print_function
import contextlib
from distutils.version import LooseVersion
import os
import sys
import yaml
from cloudbio.custom import sy... | mit | 6586424a1f26b20a2f54b13b229eb525 | 43.623786 | 111 | 0.591569 | 3.541025 | false | false | false | false |
crossbario/autobahn-python | autobahn/websocket/util.py | 2 | 6422 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | b37334417f612be8cbf2a1a6a4c5afb5 | 33.342246 | 114 | 0.627686 | 4.072289 | false | false | false | false |
crossbario/autobahn-python | autobahn/wamp/test/test_wamp_serializer.py | 2 | 23177 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | d25a8df378e47f5dd83fd97aec990a3d | 41.448718 | 161 | 0.595332 | 4.225524 | false | true | false | false |
crossbario/autobahn-python | examples/asyncio/wamp/pubsub/options/frontend.py | 1 | 2341 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | b4d2f629b2915d4c3bc366770e6b79c7 | 38.677966 | 117 | 0.673217 | 4.467557 | false | false | false | false |
crossbario/autobahn-python | examples/asyncio/wamp/rpc/slowsquare/backend.py | 3 | 2060 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | bd26d7ae713cbf43eb5d80b63a808441 | 35.785714 | 79 | 0.664563 | 4.497817 | false | false | false | false |
crossbario/autobahn-python | examples/asyncio/wamp/rpc/progress/backend.py | 3 | 2190 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 93d39dceb1a17ae3118d5d2584e58fc6 | 38.107143 | 95 | 0.658904 | 4.553015 | false | false | false | false |
crossbario/autobahn-python | examples/asyncio/wamp/component/backend.py | 1 | 1145 |
from autobahn.asyncio.component import Component, run
from autobahn.wamp.types import RegisterOptions
import asyncio
import ssl
context = ssl.create_default_context(
purpose=ssl.Purpose.SERVER_AUTH,
cafile='../../../router/.crossbar/server.crt',
)
component = Component(
transports=[
{
... | mit | 5005a17082005168a26d8f4b4c50641d | 20.603774 | 53 | 0.537118 | 3.778878 | false | false | false | false |
crossbario/autobahn-python | autobahn/twisted/util.py | 2 | 13640 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 329e13696984a12292c61caa247b3ece | 43.868421 | 148 | 0.637243 | 4.331534 | false | false | false | false |
crossbario/autobahn-python | autobahn/xbr/test/test_xbr_frealm.py | 2 | 7549 | import os
import sys
from unittest import skipIf
from unittest.mock import MagicMock
from twisted.trial.unittest import TestCase
from twisted.internet.defer import inlineCallbacks
from autobahn.xbr import HAS_XBR
from autobahn.wamp.cryptosign import HAS_CRYPTOSIGN
if HAS_XBR and HAS_CRYPTOSIGN:
from autobahn.xbr... | mit | 195006c4a0b79a89e71b512fbfa7a93b | 40.251366 | 110 | 0.602199 | 3.362584 | false | true | false | false |
crossbario/autobahn-python | examples/twisted/wamp/pubsub/unsubscribe/frontend.py | 3 | 2743 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | fbcb1300f76b7cb8302ac6ddeed48300 | 35.573333 | 79 | 0.647831 | 4.460163 | false | false | false | false |
crossbario/autobahn-python | examples/xbr/test_typed.py | 3 | 3160 | import sys
import argparse
import os
from binascii import b2a_hex, a2b_hex
import web3
from autobahn import xbr
import eth_keys
from eth_account import Account
from cfxdb import pack_uint256, unpack_uint256, pack_uint128, unpack_uint128
def main(accounts):
from py_eth_sig_utils import signing, utils
from au... | mit | 2f245e957e46661ec069a62d366bfee2 | 31.57732 | 123 | 0.653165 | 3.336853 | false | false | false | false |
crossbario/autobahn-python | examples/asyncio/wamp/rpc/errors/frontend.py | 3 | 3096 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 2129728c81621d03660437a2c73cf37d | 33.4 | 80 | 0.621447 | 4.342216 | false | false | false | false |
crossbario/autobahn-python | examples/twisted/wamp/work/newapi/test_newapi2.py | 3 | 1046 | from twisted.internet.task import react
from twisted.internet.defer import inlineCallbacks as coroutine
from autobahn.twisted.wamp import Session
from autobahn.twisted.connection import Connection
class MySession(Session):
@coroutine
def on_join(self, details):
print("on_join: {}".format(details))
... | mit | a47d99d0af8844977377811d45842860 | 23.904762 | 63 | 0.608031 | 3.932331 | false | false | false | false |
crossbario/autobahn-python | examples/asyncio/wamp/rpc/timeservice/frontend.py | 3 | 2079 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 3b87d8d3578add04af6d6346973b126a | 35.473684 | 79 | 0.660414 | 4.529412 | false | false | false | false |
crossbario/autobahn-python | examples/twisted/wamp/pubsub/retained/backend.py | 3 | 2351 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | d9a6c2b975360841e85591fa8e5fc73f | 38.847458 | 79 | 0.667376 | 4.556202 | false | false | false | false |
crossbario/autobahn-python | examples/twisted/wamp/app/crochet/example2/server.py | 3 | 3148 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 69d655f30abde1ba6fdf72d36abb9ad9 | 29.563107 | 87 | 0.676302 | 3.853121 | false | false | false | false |
crossbario/autobahn-python | autobahn/nvx/_utf8validator.py | 2 | 2659 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 66d0bf85da517b15c8620b6698bbaaaf | 31.426829 | 99 | 0.639714 | 3.507916 | false | false | false | false |
crossbario/autobahn-python | autobahn/xbr/_buyer.py | 2 | 27926 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 412f01fbb013f71a78d68013ffa968e0 | 42.908805 | 238 | 0.535236 | 4.62045 | false | false | false | false |
crossbario/autobahn-python | examples/asyncio/wamp/pubsub/complex/frontend.py | 3 | 2456 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 988779202bc8d817b5ea6af82ff18d44 | 37.984127 | 114 | 0.67386 | 4.278746 | false | false | false | false |
crossbario/autobahn-python | examples/twisted/wamp/rpc/arguments/backend.py | 3 | 2604 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 6ed1bd52f6465354f56df61c0c3aba03 | 36.2 | 79 | 0.655146 | 4.369128 | false | false | false | false |
crossbario/autobahn-python | autobahn/asyncio/component.py | 1 | 15953 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 35bb41c3e38b43d8db2fc8e6ab507bf5 | 37.256595 | 126 | 0.592052 | 4.578932 | false | false | false | false |
crossbario/autobahn-python | autobahn/wamp/serializer.py | 2 | 36432 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | acf26b2c42565b242b08f1e29c6a539c | 33.664129 | 235 | 0.582208 | 4.335079 | false | false | false | false |
crossbario/autobahn-python | autobahn/websocket/compress.py | 3 | 4566 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | f615ec600dc15ce4d25d1f0753e05e54 | 34.395349 | 81 | 0.689225 | 4.287324 | false | false | false | false |
crossbario/autobahn-python | examples/twisted/wamp/pubsub/basic/backend.py | 3 | 2100 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 4c6eaad83517d66793ec05cc977345ca | 37.181818 | 79 | 0.672381 | 4.555315 | false | false | false | false |
crossbario/autobahn-python | autobahn/xbr/_eip712_authority_certificate.py | 2 | 19333 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 131994a363a909411a1b8717347b77dd | 40.84632 | 163 | 0.525216 | 4.857538 | false | false | false | false |
crossbario/autobahn-python | examples/twisted/wamp/work/newapi/test_newapi_pubreg_decorator.py | 3 | 2606 | import txaio
from twisted.internet.defer import inlineCallbacks
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet.endpoints import SSL4ClientEndpoint
from twisted.internet.endpoints import UNIXClientEndpoint
from twisted.internet.ssl import optionsForClientTLS, trustRootFromCertificates, ... | mit | 6374a0d3ad5ce6ef8934d99044a258b6 | 29.302326 | 112 | 0.692249 | 3.798834 | false | false | false | false |
crossbario/autobahn-python | autobahn/twisted/test/test_tx_websocket_agent.py | 3 | 2078 | from twisted.trial import unittest
try:
from autobahn.twisted.testing import create_memory_agent, MemoryReactorClockResolver, create_pumper
HAVE_TESTING = True
except ImportError:
HAVE_TESTING = False
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.websocket import WebSocketServer... | mit | eed9924967007317219a65207ac44c53 | 25.987013 | 103 | 0.615977 | 4.258197 | false | true | false | false |
crossbario/autobahn-python | examples/twisted/wamp/rpc/progress/frontend.py | 3 | 2239 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 59ec9a48052fe38702b25803434a894c | 35.112903 | 98 | 0.675301 | 4.486974 | false | false | false | false |
crossbario/autobahn-python | examples/twisted/websocket/wrapping/server_endpoint.py | 3 | 2044 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 579fcbfacc22ff234aa351f65cf2998b | 35.5 | 88 | 0.689335 | 4.656036 | false | false | false | false |
crossbario/autobahn-python | examples/asyncio/wamp/pubsub/complex/backend.py | 3 | 2264 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | fff3dd52ee796de3b048f62e66fbc15d | 37.372881 | 90 | 0.661219 | 4.387597 | false | false | false | false |
crossbario/autobahn-python | examples/twisted/wamp/meta/backend.py | 3 | 2700 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 038799f18c5afd28e146d3947c80225f | 36.5 | 86 | 0.639259 | 4.51505 | false | false | false | false |
crossbario/autobahn-python | examples/twisted/websocket/wrapping/client_endpoint.py | 3 | 2049 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 78edeed73ea3a1c8d06888babcfc345e | 35.589286 | 99 | 0.690581 | 4.656818 | false | false | false | false |
crossbario/autobahn-python | examples/twisted/websocket/wxpython/server.py | 3 | 2828 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit | 0f13867c619073ec2735f81f6532a7f3 | 33.072289 | 79 | 0.673621 | 4.576052 | false | false | false | false |
demisto/content | Packs/FeedReversingLabsRansomwareAndRelatedToolsApp/Integrations/ReversingLabsRansomwareAndRelatedToolsFeed/ReversingLabsRansomwareAndRelatedToolsFeed.py | 2 | 10316 | from CommonServerPython import *
VERSION = "v1.0.0"
USER_AGENT = f"ReversingLabs XSOAR Ransomware Feed {VERSION}"
MAX_HOURS_HISTORICAL = 4
ALLOWED_INDICATOR_TYPES = ("ipv4", "domain", "hash", "uri")
INDICATOR_TYPE_MAP = {
"ipv4": FeedIndicatorType.IP,
"domain": FeedIndicatorType.Domain,
"hash": FeedInd... | mit | aebc0d88e122296850ccdbc5263a6543 | 28.059155 | 121 | 0.61235 | 3.849254 | false | false | false | false |
demisto/content | Packs/OpenLDAP/Integrations/OpenLDAP/OpenLDAP.py | 2 | 32938 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import ssl
from ldap3 import Server, Connection, Tls, BASE, AUTO_BIND_TLS_BEFORE_BIND, AUTO_BIND_NO_TLS
from ldap3.utils.dn import parse_dn
from ldap3.core.exceptions import LDAPBindError, LDAPInvalidDnE... | mit | c378297af5dc25489fb9f86e96289a2c | 48.83056 | 120 | 0.550094 | 4.514529 | false | false | false | false |
demisto/content | Packs/XSOARStorage/Integrations/XSOARStorage/XSOARStorage.py | 2 | 3475 | import traceback
from typing import Any, Dict
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
SIZE_LIMIT = 1024000
MAX_SIZE = int(demisto.params().get('maxsize', SIZE_LIMIT))
MAX_SIZE = MAX_SIZE if MAX_SIZE <= SIZE_LIMIT else SIZE_LIMIT
def xsoar_store_list_command(args: ... | mit | 165c1ca4b36e0c88c0aae5c637656acc | 26.148438 | 94 | 0.631942 | 3.586171 | false | false | false | false |
demisto/content | Packs/Malwr/Integrations/Malwr/Malwr.py | 2 | 12712 | import ast
import hashlib
import re
from typing import Any
import demistomock as demisto # noqa: F401
import requests
from bs4 import BeautifulSoup
from CommonServerPython import * # noqa: F401
MAIN_URL = 'https://malwr.com'
STATUS_URL = '/submission/status/{}/'
RESULT_URL = '/analysis/{}/'
MD5_PREFIX_STR = 'with M... | mit | 008ad95264ba6753ea7f565f5532f974 | 36.169591 | 120 | 0.557898 | 3.893415 | false | false | false | false |
demisto/content | Utils/github_workflow_scripts/handle_external_pr.py | 2 | 6195 | #!/usr/bin/env python3
import json
from typing import List
import urllib3
from blessings import Terminal
from github import Github
from github.Repository import Repository
from utils import get_env_var, timestamped_print
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
print = timestamped_print
... | mit | 6e9efbc32e74c058b2c252bf7ea77f07 | 46.290076 | 120 | 0.676998 | 3.66568 | false | false | false | false |
demisto/content | Packs/ParseHTMLTables/Scripts/ParseHTMLTables/ParseHTMLTables.py | 2 | 12014 | import copy
from typing import Any, Dict, Generator, List, Optional, Tuple, Union
from bs4 import BeautifulSoup, NavigableString, Tag
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
TITLE_THRESHOLD = 4
class Table:
def __init__(self, title: str):
self.__title ... | mit | d17476da5c6d0fcd96966fd50079bdbc | 32.465181 | 117 | 0.536707 | 4.105947 | false | false | false | false |
demisto/content | Packs/cyberark_AIM/Integrations/CyberArkAIM_v2/CyberArkAIM_v2.py | 2 | 7151 | from requests_ntlm import HttpNtlmAuth
import tempfile
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
class Client(BaseClient):
def __init__(self, server_url: str, use_ssl: bool, proxy: ... | mit | bf7f4c1f83eeb39b0dc7afe06310eb50 | 35.671795 | 110 | 0.599776 | 4.019674 | false | false | false | false |
demisto/content | Packs/FireMonSecurityManager/Integrations/FireMonSecurityManager/FireMonSecurityManager.py | 2 | 17978 | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
""" IMPORTS """
from typing import Any, Dict
""" CONSTANTS """
DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
AUTH_URL = "securitymanager/api/authentication/login"
WORKFLOW_URL = "/policyplanner/api/domain/{0}/workflow/version/latest/all"
... | mit | b1184062b5e6efb36a3cbca76e4347e5 | 39.674208 | 119 | 0.595339 | 3.995999 | false | false | false | false |
demisto/content | Packs/qualys/Scripts/QualysCreateIncidentFromReport/QualysCreateIncidentFromReport_test.py | 2 | 1514 | import demistomock as demisto
from QualysCreateIncidentFromReport import main, get_asset_id_for_ip
def test_main(mocker):
"""
Tests the full flow of the script
Given: A valid report and successful responses
When: Running the QualysCreateIncidentReport script
Then: Return a success... | mit | 886a48666321dd9bda2f4b505fcda0d6 | 37.820513 | 112 | 0.61823 | 3.692683 | false | true | false | false |
demisto/content | Tests/sdknightly/create_entities_for_nightly_sdk.py | 2 | 5120 | import argparse
import json
import os
import shutil
import subprocess
from pathlib import Path
from typing import Tuple
def run_command(cmd: str) -> Tuple[str, str]:
return subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding='utf-8').communicate()
def create_incident_field(pat... | mit | e64d42ff636457b9dd606b479bf3e445 | 30.411043 | 120 | 0.631641 | 3.664996 | false | false | false | false |
demisto/content | Packs/EmailCommunication/Scripts/PreprocessEmail/PreprocessEmail.py | 2 | 19552 | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
import json
import re
import random
from datetime import datetime as dt
ERROR_TEMPLATE = 'ERROR: PreprocessEmail - {function_name}: {reason}'
# List of strings that mail clients use to separate new message content from previou... | mit | a33931faa330f5ab07597cf2614b884e | 42.838565 | 125 | 0.62275 | 4.103253 | false | false | false | false |
demisto/content | Packs/PassiveTotal/Scripts/RiskIQPassiveTotalPDNSWidgetScript/RiskIQPassiveTotalPDNSWidgetScript.py | 2 | 1554 | from CommonServerPython import *
import traceback
from typing import Dict, Union, Any
def set_arguments_for_widget_view(indicator_data: Dict[str, Any]) -> Union[Dict[str, str], str]:
"""
Prepare argument for commands or message to set custom layout of indicator
"""
indicator_type = indicator_data... | mit | 29208e0cbda6134ef2212da78a32ff38 | 36 | 117 | 0.614543 | 3.964286 | false | false | false | false |
demisto/content | Packs/SignalSciences/Integrations/SignalSciences/SignalSciences.py | 2 | 56744 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import json
import requests
''' GLOBAL VARS '''
''' GLOBAL VARS '''
USE_SSL = not demisto.params().get('insecure', False)
handle_proxy()
EMAIL = demisto.params()['Email']
TOKEN = demisto.params()['Token... | mit | 1bc9bc8bb03a1bfe62cfb8658634c1e3 | 38.570432 | 123 | 0.642376 | 3.55294 | false | false | false | false |
demisto/content | Utils/tests/update_contribution_pack_in_base_branch_test.py | 2 | 5715 | from Utils.update_contribution_pack_in_base_branch import get_pr_files
import os
github_response_1 = [
{
"sha": "1",
"filename": "hmm",
"status": "modified",
"additions": 1,
"deletions": 0,
"changes": 1,
"blob_url": "https://github.com/demisto/content/blob/1/... | mit | 4d6b63ad47ff45506808b0192eda84bd | 32.421053 | 108 | 0.574453 | 3.192737 | false | false | false | false |
demisto/content | Packs/XMatters/Integrations/xMatters/xMatters.py | 2 | 28630 | import demistomock as demisto
from CommonServerPython import *
import requests
import json
import dateparser
import traceback
import urllib.parse
from typing import Any, Dict, Tuple, List, Optional, cast
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
# Disable insecure warnings
requests.packages.urllib3.disable... | mit | 3e6ea05b56b33e90526879910ac5ea0b | 34 | 117 | 0.593014 | 4.072546 | false | false | false | false |
demisto/content | Packs/DeveloperTools/Scripts/CompareIndicators/CompareIndicators_test.py | 2 | 3339 | from CompareIndicators import collect_unique_indicators_from_lists, extract_list_from_args, demisto
def test_collect_unique_indicators_from_lists__empty():
"""
Given:
- Empty lists
When:
- Calling collect_unique_indicators_from_lists
Then:
- Return 2 empty lists
"""
lis... | mit | 4f8a606394e6e83ed64f58a6194ddd32 | 29.633028 | 99 | 0.580413 | 3.204415 | false | true | false | false |
demisto/content | Packs/ApiModules/Scripts/SiemApiModule/SiemApiModule.py | 2 | 4888 | # pylint: disable=no-name-in-module
# pylint: disable=no-self-argument
from abc import ABC
from typing import Any, Callable, Optional
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from enum import Enum
from pydantic import BaseConfig, BaseModel, AnyUrl, validator,... | mit | d4e818f5bd65ab7c1e1b545924deaebf | 28.095238 | 89 | 0.611088 | 4.250435 | false | false | false | false |
demisto/content | Packs/TrendMicroVisionOne/Integrations/TrendMicroVisionOne/TrendMicroVisionOne_test.py | 2 | 26715 | from TrendMicroVisionOne import (
Client,
add_or_remove_from_block_list,
quarantine_or_delete_email_message,
isolate_or_restore_connection,
terminate_process,
add_or_delete_from_exception_list,
add_to_suspicious_list,
delete_from_suspicious_list,
get_file_analysis_status,
get_fil... | mit | 38d9d264545d83752a2e51cb0661fa76 | 33.338046 | 81 | 0.618117 | 3.537474 | false | true | false | false |
demisto/content | Packs/URLHaus/Integrations/URLHaus/URLHaus.py | 2 | 30095 | from typing import Tuple
from CommonServerPython import *
''' IMPORTS '''
import traceback
import requests
import zipfile
import io
import re
from datetime import datetime as dt
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
# disable-secrets-detection-start
# Whether compromised websites a... | mit | 4f57b24bfa44ba22d48253d0364d6870 | 38.650856 | 120 | 0.576209 | 4.285816 | false | false | false | false |
demisto/content | Packs/RSANetWitnessEndpoint/Integrations/RSANetWitnessEndpoint/RSANetWitnessEndpoint_test.py | 2 | 2014 | from CommonServerPython import *
class ResponseMock:
def __init__(self, _json):
self.status_code = 404
self._json = _json
self.headers = {'Content-Type': 'text\html'}
self.text = "<div>" \
"<html> some text </html>" \
"</div>"
self.Re... | mit | d0b11a5f1282396da0d1c021ff83cbaf | 38.490196 | 108 | 0.527805 | 4.349892 | false | true | false | false |
demisto/content | Packs/PagerDuty/Integrations/PagerDuty/PagerDuty.py | 2 | 33138 | import demistomock as demisto
from CommonServerUserPython import *
from CommonServerPython import *
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' GLOBAL VARS '''
# PagerDuty API works only with secured communication.
USE_SSL = not demisto.params().get('insecure', False)
USE_PROXY = de... | mit | ce28ef17332da39944bf0799b30f7ae8 | 37.577416 | 120 | 0.609059 | 3.815105 | false | false | false | false |
demisto/content | Packs/DeHashed/Integrations/DeHashed/DeHashed_test.py | 2 | 12255 | import json
import urllib
DEHASHED_URL = "https://url.com/" # disable-secrets-detection
INTEGRATION_CONTEXT_BRAND = "DeHashed"
def load_test_data(json_path):
with open(json_path) as f:
return json.load(f)
def test_module_command(requests_mock):
"""
Given:
- Performs a basic GET request... | mit | 7dc17b8ce5033ade0dc38b0dabcdb283 | 31.081152 | 105 | 0.60408 | 3.622524 | false | true | false | false |
demisto/content | Packs/CommonScripts/Scripts/GetFieldsByIncidentType/GetFieldsByIncidentType.py | 2 | 1942 | import demistomock as demisto
from CommonServerPython import *
from pprint import pformat
def main():
# get incident fields
res = demisto.executeCommand('demisto-api-get', {'uri': '/incidentfields'})
if is_error(res):
return_error(res[0]['Contents'])
fields = res[0]['Contents']['response']
... | mit | 5802c53821476a9e6ada7f0048453cac | 33.070175 | 102 | 0.659114 | 4.123142 | false | false | false | false |
demisto/content | Packs/SMB/Integrations/SMB/SMB.py | 2 | 4445 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import tempfile
from smb.SMBConnection import SMBConnection
''' GLOBAL VARS '''
USER = demisto.params()['credentials']['identifier']
PASSWORD = demisto.params()['credentials']['password']
HOSTNAME ... | mit | ca65fe8829c5375e4073ce9fb0e68bc5 | 35.735537 | 119 | 0.659393 | 3.878709 | false | false | false | false |
demisto/content | Packs/AnsibleCiscoIOS/Integrations/AnsibleCiscoIOS/AnsibleCiscoIOS.py | 2 | 4355 | import ssh_agent_setup
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# Import Generated code
from AnsibleApiModule import * # noqa: E402
host_type = 'ios'
# MAIN FUNCTION
def main() -> None:
"""main function, parses params and runs command functions
:return:
... | mit | f3176852190a46d2573c424ce0242fb7 | 45.329787 | 107 | 0.623881 | 3.77383 | false | false | false | false |
demisto/content | Packs/VulnDB/Integrations/VulnDB/VulnDB.py | 2 | 16142 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import requests
import urllib.parse
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
''' HELPER FUNCTIONS '''
class Client(BaseClient):
def __init__(self, proxy, use_ssl... | mit | c004b4ba33e9765894624c1b1ecfe526 | 36.62704 | 119 | 0.599244 | 3.471398 | false | false | false | false |
demisto/content | Packs/SafeBreach/Scripts/JoinListsOfDicts/JoinListsOfDicts_test.py | 2 | 1464 | import demistomock as demisto
from JoinListsOfDicts import main as JoinListsOfDicts
LEFT_DICTS = [{
"insightIds": ['1', '2', '3'],
"value": "value123"
}, {
"insightIds": ['1'],
"value": "value1"
}, {
"insightIds": ['3'],
"value": "value3"
}]
RIGHT_DICTS = [{
"id": 1,
"name": "someInsig... | mit | 4ed2b297b74594943d68f29fca5a9cd7 | 24.684211 | 68 | 0.578552 | 2.969574 | false | false | false | false |
demisto/content | Packs/AbnormalSecurity/Integrations/AbnormalSecurityEventCollector/AbnormalSecurityEventCollector.py | 2 | 4399 | from CommonServerPython import *
import demistomock as demisto
VENDOR = 'Abnormal_Security'
PRODUCT = 'Email_Protection'
class Client(BaseClient):
def list_threats(self, params):
return self._http_request('GET', params=params, url_suffix='threats')
def get_threat(self, threat_id):
return sel... | mit | 499ac98342c0ecb8e2a42a871220adfc | 32.838462 | 120 | 0.622414 | 3.753413 | false | false | false | false |
demisto/content | Packs/CohesityHelios/Integrations/CohesityHelios/CohesityHelios_test.py | 2 | 3520 | """Cohesity Helios Cortex XSOAR - Unit Tests file
"""
import json
import io
BASE_URL = "https://helios.cohesity.com/"
ALERTS_URL = BASE_URL + "mcm/alerts"
ALERT_DETAIL_URL = BASE_URL + "mcm/alerts/6595940238747379:1630539139046817"
RESTORE_OBJECT_URL = BASE_URL + "irisservices/api/v1/public/restore/recover"
MOCK_OBJE... | mit | 86d769af73b245d290123ef4c78ba5a4 | 31.293578 | 79 | 0.705966 | 3.365201 | false | true | false | false |
missionpinball/mpf | mpf/tests/test_Delay.py | 1 | 4931 | from mpf.tests.MpfTestCase import MpfTestCase
from unittest.mock import MagicMock
class TestDelay(MpfTestCase):
def callback(self):
pass
def test_basic_functions(self):
self.callback = MagicMock()
self.assertEqual(len(self.machine.delay.delays), 0)
# Create a one second dela... | mit | 075e8be9303cce4034d69875e6e7f038 | 35.525926 | 88 | 0.627053 | 3.641802 | false | true | false | false |
missionpinball/mpf | mpf/core/file_manager.py | 1 | 3664 | """Contains the FileManager base classes."""
import logging
import os
from mpf.file_interfaces.pickle_interface import PickleInterface
from mpf.file_interfaces.yaml_interface import YamlInterface
MYPY = False
if MYPY: # pragma: no cover
from typing import Dict, List # pylint: disable-msg=cyclic-import,unused... | mit | ac6906e7b2464a89ec5e2fde3c2148b8 | 28.788618 | 99 | 0.599345 | 4.540273 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/sharefile/views.py | 2 | 1432 | import requests
from allauth.socialaccount import app_settings
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import ShareFileProvider
class ShareFileOAuth2Adapter(OAuth2Adapter):
provider_id = ShareFileProvider.id
... | mit | 12a56e1c164aaf9a5d3b7649d13179e8 | 37.702703 | 86 | 0.717179 | 3.509804 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/exist/provider.py | 2 | 1152 | from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class ExistAccount(ProviderAccount):
def get_profile_url(self):
username = self.account.extra_data.get("username")
return "https://exist.io/api/1/users/{}/pro... | mit | c2d3a5e43424a81d65232519a84d6229 | 28.538462 | 77 | 0.657986 | 3.74026 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/gitea/provider.py | 2 | 1165 | from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class GiteaAccount(ProviderAccount):
def get_profile_url(self):
return self.account.extra_data.get("html_url")
def get_avatar_url(self):
return self.acco... | mit | 0e9e414a73879bcd6c828620c875163b | 24.888889 | 74 | 0.592275 | 3.832237 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/mailchimp/views.py | 2 | 1071 | """Views for MailChimp API v3."""
import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import MailChimpProvider
class MailChimpOAuth2Adapter(OAuth2Adapter):
"""OAuth2Adapter for MailChimp API v3."""
prov... | mit | 0fc4108e5dcb7c49f5e7bc7e69cc4d70 | 32.46875 | 81 | 0.730159 | 3.57 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/mailchimp/provider.py | 2 | 1411 | """Customise Provider classes for MailChimp API v3."""
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class MailChimpAccount(ProviderAccount):
"""ProviderAccount subclass for MailChimp."""
def get_profile_url(self):... | mit | f5e453c33582cafc37b22062b1e85273 | 28.395833 | 74 | 0.627215 | 3.952381 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/trello/views.py | 2 | 1155 | import requests
from django.utils.http import urlencode
from allauth.socialaccount.providers.oauth.views import (
OAuthAdapter,
OAuthCallbackView,
OAuthLoginView,
)
from .provider import TrelloProvider
class TrelloOAuthAdapter(OAuthAdapter):
provider_id = TrelloProvider.id
request_token_url = "... | mit | 83859a6d6f148741256444f59ade449a | 32.970588 | 84 | 0.698701 | 3.553846 | false | false | false | false |
pennersr/django-allauth | allauth/socialaccount/providers/twitter/views.py | 2 | 1445 | import json
from allauth.socialaccount.app_settings import QUERY_EMAIL
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (
OAuthAdapter,
OAuthCallbackView,
OAuthLoginView,
)
from .provider import TwitterProvider
class TwitterAPI(OAuth)... | mit | c40d3c269caf3ee115a452457e53ad9b | 33.404762 | 87 | 0.725952 | 3.639798 | false | false | false | false |
mosra/m.css | plugins/m/vk.py | 1 | 3102 | #
# This file is part of m.css.
#
# Copyright © 2017, 2018, 2019, 2020, 2021, 2022
# Vladimír Vondruš <mosra@centrum.cz>
#
# 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 Softwar... | mit | d59b834740bb15cf9b960bbb82dc3af4 | 40.878378 | 113 | 0.704098 | 3.398026 | false | false | false | false |
simpleai-team/simpleai | simpleai/search/traditional.py | 5 | 5707 | # coding=utf-8
from simpleai.search.utils import FifoList, BoundedPriorityQueue, LifoList
from simpleai.search.models import (SearchNode, SearchNodeHeuristicOrdered,
SearchNodeStarOrdered,
SearchNodeCostOrdered)
def breadth_first(problem, graph_s... | mit | a6519f2d9064e533a69f55aee047c831 | 31.988439 | 89 | 0.583669 | 4.396764 | false | false | false | false |
simpleai-team/simpleai | tests/search/test_local.py | 1 | 3196 | # coding=utf-8
import unittest
from tests.search.dummies import DummyProblem, GOAL, DummyGeneticProblem
from simpleai.search.local import (beam, beam_best_first,
hill_climbing,
hill_climbing_stochastic,
simulated_an... | mit | 885b40ea97dcbfda320bb306f0d6ec54 | 35.318182 | 95 | 0.613267 | 3.665138 | false | true | false | false |
simpleai-team/simpleai | tests/machine_learning/test_classifiers.py | 1 | 9496 | #!/usr/bin/env python
# coding: utf-8
"""
Tests for dtree.
"""
import os
import math
import tempfile
import unittest
from collections import defaultdict
import numpy as np
from simpleai.machine_learning import evaluation
from simpleai.machine_learning.models import VectorDataClassificationProblem
from simpleai.mach... | mit | 984b97627d75f543bbeb5c6918f23bf0 | 32.087108 | 92 | 0.638795 | 3.883845 | false | true | false | false |
bernardopires/django-tenant-schemas | examples/tenant_tutorial/customers/views.py | 9 | 1718 | from django.contrib.auth.models import User
from django.db.utils import DatabaseError
from django.views.generic import FormView
from customers.forms import GenerateUsersForm
from customers.models import Client
from random import choice
class TenantView(FormView):
form_class = GenerateUsersForm
template_name =... | mit | fa3498cd7662ab76e78bb35bd9a42182 | 38.045455 | 76 | 0.558789 | 3.726681 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.