_id stringlengths 2 7 | title stringclasses 1
value | partition stringclasses 3
values | text stringlengths 6 2.61k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
c14100 | train | // Uses the Client Credentials Grant oauth2 flow to authenticate to Bitbucket | {
"resource": ""
} | ||
c14101 | train | // Implement the Go color.Color interface. | {
"resource": ""
} | ||
c14102 | train | // Constructs a colorful.Color from something implementing color.Color | {
"resource": ""
} | ||
c14103 | train | // Might come in handy sometimes to reduce boilerplate code. | {
"resource": ""
} | ||
c14104 | train | // DistanceRgb computes the distance between two colors in RGB space.
// This is not a good measure! Rather do it in Lab space. | {
"resource": ""
} | ||
c14105 | train | // A much faster and still quite precise linearization using a 6th-order Taylor approximation.
// See the accompanying Jupyter notebook for derivation of the constants. | {
"resource": ""
} | ||
c14106 | train | // XyzToLinearRgb converts from CIE XYZ-space to Linear RGB space. | {
"resource": ""
} | ||
c14107 | train | // DistanceLab is a good measure of visual similarity between two colors!
// A result of 0 would mean identical colors, while a result of 1 or higher
// means the colors differ a lot. | {
"resource": ""
} | ||
c14108 | train | // Uses the CIE94 formula to calculate color distance. More accurate than
// DistanceLab, but also more work. | {
"resource": ""
} | ||
c14109 | train | // For this part, we do as R's graphics.hcl does, not as wikipedia does.
// Or is it the same? | {
"resource": ""
} | ||
c14110 | train | // DistanceLuv is a good measure of visual similarity between two colors!
// A result of 0 would mean identical colors, while a result of 1 or higher
// means the colors differ a lot. | {
"resource": ""
} | ||
c14111 | train | // This is a very nice thing Golang forces you to do!
// It is necessary so that we can write out the literal of the colortable below. | {
"resource": ""
} | ||
c14112 | train | // A wrapper which uses common parameters. | {
"resource": ""
} | ||
c14113 | train | // That's faster than using colorful's DistanceLab since we would have to
// convert back and forth for that. Here is no conversion. | {
"resource": ""
} | ||
c14114 | train | // NewHook returns new LFS hook.
// Output can be a string, io.Writer, WriterMap or PathMap.
// If using io.Writer or WriterMap, user is responsible for closing the used io.Writer. | {
"resource": ""
} | ||
c14115 | train | // SetFormatter sets the format that will be used by hook.
// If using text formatter, this method will disable color output to make the log file more readable. | {
"resource": ""
} | ||
c14116 | train | // SetDefaultPath sets default path for levels that don't have any defined output path. | {
"resource": ""
} | ||
c14117 | train | // SetDefaultWriter sets default writer for levels that don't have any defined writer. | {
"resource": ""
} | ||
c14118 | train | // Fire writes the log file to defined path or using the defined writer.
// User who run this function needs write permissions to the file or directory if the file does not yet exist. | {
"resource": ""
} | ||
c14119 | train | // Write a log line to an io.Writer. | {
"resource": ""
} | ||
c14120 | train | // Write a log line directly to a file. | {
"resource": ""
} | ||
c14121 | train | // New creates a new Servo interface. | {
"resource": ""
} | ||
c14122 | train | // SetAngle sets the servo angle. | {
"resource": ""
} | ||
c14123 | train | // SetMicroseconds sends a command to the PWM driver to generate a us wide pulse. | {
"resource": ""
} | ||
c14124 | train | // Close closes the open driver handle. | {
"resource": ""
} | ||
c14125 | train | // New creates a new interface for matrix4x3. | {
"resource": ""
} | ||
c14126 | train | // Pressed key returns the current key pressed on the keypad. | {
"resource": ""
} | ||
c14127 | train | // Run starts the continuous key scan loop. | {
"resource": ""
} | ||
c14128 | train | // NewGPIODriver returns a GPIODriver interface which allows control
// over the GPIO subsystem. | {
"resource": ""
} | ||
c14129 | train | // InitI2C initializes the I2C driver. | {
"resource": ""
} | ||
c14130 | train | // NewI2CBus returns a I2CBus. | {
"resource": ""
} | ||
c14131 | train | // NewSPIDriver returns a SPIDriver interface which allows control
// over the SPI bus. | {
"resource": ""
} | ||
c14132 | train | // Bus returns a SPIBus interface which allows us to use spi functionalities | {
"resource": ""
} | ||
c14133 | train | // Close cleans up all the initialized SPIbus | {
"resource": ""
} | ||
c14134 | train | // Register makes a host describer available by the provided host key.
// If Register is called twice with the same host or if describer is nil,
// it panics. | {
"resource": ""
} | ||
c14135 | train | // SetHost overrides the host and revision no. | {
"resource": ""
} | ||
c14136 | train | // DescribeHost returns the detected host descriptor.
// Can be overriden by calling SetHost though. | {
"resource": ""
} | ||
c14137 | train | // New creates a new LSM303 interface. The bus variable controls
// the I2C bus used to communicate with the device. | {
"resource": ""
} | ||
c14138 | train | // Initialize the device | {
"resource": ""
} | ||
c14139 | train | // Heading returns the current heading [0, 360). | {
"resource": ""
} | ||
c14140 | train | // Close the sensor data acquisition loop and put the LSM303 into sleep mode. | {
"resource": ""
} | ||
c14141 | train | // IsWet determines if there is water present on the sensor | {
"resource": ""
} | ||
c14142 | train | // New returns a handle to a BMP085 sensor. | {
"resource": ""
} | ||
c14143 | train | // Pressure returns the current pressure reading. | {
"resource": ""
} | ||
c14144 | train | // Altitude returns the current altitude reading. | {
"resource": ""
} | ||
c14145 | train | // NewGPIO creates a new HD44780 connected by a 4-bit GPIO bus. | {
"resource": ""
} | ||
c14146 | train | // New creates a new HD44780 connected by a Connection bus. | {
"resource": ""
} | ||
c14147 | train | // SetModes modifies the entry mode, display mode, and function mode with the
// given mode setter functions. | {
"resource": ""
} | ||
c14148 | train | // Home moves the cursor and all characters to the home position. | {
"resource": ""
} | ||
c14149 | train | // Clear clears the display and mode settings sets the cursor to the home position. | {
"resource": ""
} | ||
c14150 | train | // SetDDRamAddr sets the input cursor to the given address. | {
"resource": ""
} | ||
c14151 | train | // WriteInstruction writes a byte to the bus with register select in data mode. | {
"resource": ""
} | ||
c14152 | train | // WriteInstruction writes a byte to the bus with register select in command mode. | {
"resource": ""
} | ||
c14153 | train | // NewGPIOConnection returns a new Connection based on a 4-bit GPIO bus. | {
"resource": ""
} | ||
c14154 | train | // Write writes a register select flag and byte to the 4-bit GPIO connection. | {
"resource": ""
} | ||
c14155 | train | // Close closes all open DigitalPins. | {
"resource": ""
} | ||
c14156 | train | // New creates a new US020 interface. The bus variable controls
// the I2C bus used to communicate with the device. | {
"resource": ""
} | ||
c14157 | train | // Distance computes the distance of the bot from the closest obstruction. | {
"resource": ""
} | ||
c14158 | train | // InitGPIO initializes the GPIO driver. | {
"resource": ""
} | ||
c14159 | train | // NewDigitalPin returns a DigitalPin interface which allows control over
// the digital GPIO pin. | {
"resource": ""
} | ||
c14160 | train | // DigitalWrite writes val to the pin. | {
"resource": ""
} | ||
c14161 | train | // DigitalRead reads a value from the pin. | {
"resource": ""
} | ||
c14162 | train | // ActiveLow makes the pin active low. A low logical state is represented by
// a high state on the physical pin, and vice-versa. | {
"resource": ""
} | ||
c14163 | train | // PullUp pulls the pin up. | {
"resource": ""
} | ||
c14164 | train | // PullDown pulls the pin down. | {
"resource": ""
} | ||
c14165 | train | // NewAnalogPin returns a AnalogPin interface which allows control over
// the analog GPIO pin. | {
"resource": ""
} | ||
c14166 | train | // AnalogWrite reads a value from the pin. | {
"resource": ""
} | ||
c14167 | train | // NewPWMPin returns a PWMPin interface which allows PWM signal
// generation over a the PWM pin. | {
"resource": ""
} | ||
c14168 | train | // DetectHost returns the detected host and its revision number. | {
"resource": ""
} | ||
c14169 | train | // New creates a new L3GD20 interface. The bus variable controls
// the I2C bus used to communicate with the device. | {
"resource": ""
} | ||
c14170 | train | // Orientations returns a channel which will have the current temperature reading. | {
"resource": ""
} | ||
c14171 | train | // Stop the data acquisition loop. | {
"resource": ""
} | ||
c14172 | train | // SetVoltage sets the output voltage. | {
"resource": ""
} | ||
c14173 | train | // SetPersistedVoltage sets the voltage and programs the EEPROM so
// that the voltage is restored on reboot. | {
"resource": ""
} | ||
c14174 | train | // Close puts the DAC into power down mode. | {
"resource": ""
} | ||
c14175 | train | // InitSPI initializes the SPI driver. | {
"resource": ""
} | ||
c14176 | train | // NewSPIBus returns a SPIBus. | {
"resource": ""
} | ||
c14177 | train | // New returns a handle to a BMP180 sensor. | {
"resource": ""
} | ||
c14178 | train | // This cannot be currently used to disable things like the
// analog and pwm modules. Removing them from slots file can
// potentially cause a kernel panic and unsettle things. So the
// recommended thing to do is to simply reboot. | {
"resource": ""
} | ||
c14179 | train | // New creates a new PCA9685 interface. | {
"resource": ""
} | ||
c14180 | train | // SetMicroseconds is a convinience method which allows easy servo control. | {
"resource": ""
} | ||
c14181 | train | // Close stops the controller and resets mode and pwm controller registers. | {
"resource": ""
} | ||
c14182 | train | // Sleep puts the controller in sleep mode. Does not change the pwm control registers. | {
"resource": ""
} | ||
c14183 | train | // Wake allows the controller to exit sleep mode and resume with PWM generation. | {
"resource": ""
} | ||
c14184 | train | // New creates a new Display | {
"resource": ""
} | ||
c14185 | train | // Message prints the given string on the display, including interpreting newline
// characters and wrapping at the end of lines. | {
"resource": ""
} | ||
c14186 | train | // Close puts the device into low power mode. | {
"resource": ""
} | ||
c14187 | train | // Present checks if the device is present at the given address. | {
"resource": ""
} | ||
c14188 | train | // RawDieTemp returns the current raw die temp reading. | {
"resource": ""
} | ||
c14189 | train | // ObjTemp returns the current obj temp reading. | {
"resource": ""
} | ||
c14190 | train | // InitLED initializes the LED driver. | {
"resource": ""
} | ||
c14191 | train | // NewLED returns a LED interface which allows control over the LED. | {
"resource": ""
} | ||
c14192 | train | // LEDOn switches the LED on. | {
"resource": ""
} | ||
c14193 | train | // LEDOff switches the LED off. | {
"resource": ""
} | ||
c14194 | train | // LEDToggle toggles the LED. | {
"resource": ""
} | ||
c14195 | train | // New returns a BH1750FVI sensor at the specific resolution mode. | {
"resource": ""
} | ||
c14196 | train | // Lighting returns the ambient lighting in lx. | {
"resource": ""
} | ||
c14197 | train | // Run starts continuous sensor data acquisition loop. | {
"resource": ""
} | ||
c14198 | train | // New creates a representation of the mcp3008 convertor | {
"resource": ""
} | ||
c14199 | train | // AnalogValueAt returns the analog value at the given channel of the convertor. | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.